-
大小: 1.03MB文件类型: .rar金币: 1下载: 0 次发布日期: 2023-08-30
- 语言: C#
- 标签: C# KeyBoardMast 源码
资源简介
C# KeyBoardMaster 源码, 加入了射击音效等,分享给大家
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
namespace KeyoardMaster
{
public partial class FrmGame : Form
{
Game myGame;
public FrmGame()
{
InitializeComponent();
}
private void 开始ToolStripMenuItem_Click(object sender EventArgs e)
{
Txt.Enabled = true;
Txt.Focus();
myGame = new Game(PicShow1000);
myGame.Start();
if (timerPicShow.Enabled == false) timerPicShow.Start();
}
private void timerPicShow_Tick(object sender EventArgs e)
{
//清除bmp
Graphics grb = Graphics.FromImage(myGame.bmp);
grb.Clear(Color.Black);
//画unit
for (int i = 0; i < myGame.unitlist.Count; i++)
{
myGame.unitlist[i].Show(grb);
}
//画坦克
myGame.myTank.Show(grb);
//将bmp画到picshow
Graphics grpic = PicShow.CreateGraphics();
grpic.DrawImage(myGame.bmp 0 0);
//更新lblScore
LblScore.Text = “当前分数:“ + myGame.GetScore().ToString();
//更新lblLevel
LblLevel.Text = “Level:“ + myGame.GetLevel();
if(myGame.GetLevel()<5)
{
LblLevel.Font = new Font(“宋体“ 10 + myGame.GetLevel()Fontstyle.Italic);
LblLevel.ForeColor = Color.Black;
}
else if(myGame.GetLevel()<10)
{
LblLevel.Font = new Font(“宋体“ 10 + myGame.GetLevel()Fontstyle.Bold|Fontstyle.Italic);
LblLevel.ForeColor = Color.Blue;
}
else
{
LblLevel.Font = new Font(“楷体“ 10 + 2*myGame.GetLevel() Fontstyle.Bold | Fontstyle.Italic);
LblLevel.ForeColor = Color.Red;
}
}
private void Txt_TextChanged(object sender EventArgs e)
{
myGame.myTank.SetStr(Txt.Text);
}
private void FrmGame_Load(object sender EventArgs e)
{
Txt.Enabled = false;
}
private void Txt_KeyPress(object sender KeyPressEventArgs e)
{
if (e.KeyChar == Convert.ToChar(13))
{
//判断txt.text是否等于某个unit的名字
for (int i = 0; i < myGame.unitlist.Count; i++)
{
if (myGame.unitlist[i].GetName() == Txt.Text)
{
//声音
myGame.ShootSound();
//激光动画
myGame.myTank.SetAim(myGame.unitlist[i].GetCenterX() myGame.unitlist[i].GetCenterY());
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 189 2016-12-29 19:37 KeyoardMaster\App.config
文件 84992 2017-03-23 13:46 KeyoardMaster\bin\Debug\KeyoardMaster.exe
文件 189 2016-12-29 19:37 KeyoardMaster\bin\Debug\KeyoardMaster.exe.config
文件 38400 2017-03-23 13:46 KeyoardMaster\bin\Debug\KeyoardMaster.pdb
文件 22696 2017-03-23 13:48 KeyoardMaster\bin\Debug\KeyoardMaster.vshost.exe
文件 189 2016-12-29 19:37 KeyoardMaster\bin\Debug\KeyoardMaster.vshost.exe.config
文件 308252 2016-12-24 15:07 KeyoardMaster\bin\Debug\Sound\升级.wav
文件 328732 2016-12-24 15:07 KeyoardMaster\bin\Debug\Sound\失败.wav
文件 186672 2016-12-30 13:02 KeyoardMaster\bin\Debug\Sound\开始.wav
文件 138346 2016-12-30 12:36 KeyoardMaster\bin\Debug\Sound\激光1.wav
文件 142954 2016-12-30 12:36 KeyoardMaster\bin\Debug\Sound\激光2.wav
文件 189006 2016-12-30 12:35 KeyoardMaster\bin\Debug\Sound\激光3.wav
文件 76468 2016-12-30 13:03 KeyoardMaster\bin\Debug\Sound\落水.wav
文件 4027 2017-03-23 13:43 KeyoardMaster\FrmGame.cs
文件 6734 2017-03-23 13:43 KeyoardMaster\FrmGame.Designer.cs
文件 107988 2017-03-23 13:43 KeyoardMaster\FrmGame.resx
文件 4243 2017-03-23 13:46 KeyoardMaster\Game.cs
文件 4090 2017-03-23 13:43 KeyoardMaster\KeyoardMaster.csproj
文件 1464 2016-12-30 11:22 KeyoardMaster\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7336 2017-03-23 13:43 KeyoardMaster\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 872 2017-03-23 13:48 KeyoardMaster\obj\Debug\KeyoardMaster.csproj.FileListAbsolute.txt
文件 1136 2017-03-23 13:43 KeyoardMaster\obj\Debug\KeyoardMaster.csproj.GenerateResource.Cache
文件 2542 2016-12-30 14:37 KeyoardMaster\obj\Debug\KeyoardMaster.csprojResolveAssemblyReference.cache
文件 84992 2017-03-23 13:46 KeyoardMaster\obj\Debug\KeyoardMaster.exe
文件 68212 2017-03-23 13:43 KeyoardMaster\obj\Debug\KeyoardMaster.FrmGame.resources
文件 38400 2017-03-23 13:46 KeyoardMaster\obj\Debug\KeyoardMaster.pdb
文件 180 2017-03-23 13:43 KeyoardMaster\obj\Debug\KeyoardMaster.Properties.Resources.resources
文件 0 2016-12-29 19:37 KeyoardMaster\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2016-12-29 19:37 KeyoardMaster\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
文件 0 2016-12-29 19:37 KeyoardMaster\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
............此处省略21个文件信息
相关资源
- ASP.net源码:在线网上考试系统,专业
- C#编写的小游戏贪吃蛇源码
- C# asp.net高校教师档案管理系统项目源
- C# 留言板自己写的,带数据库
- C#写的自定义安装包,打包程序源代码
- 超市管理系统 c# sql 及设计报告
- 解析空中三角测量C#程序
- C#项目之KTV点歌系统(含源码)
- C#五子棋
- C#.NET多线程6个(包括多线程基本使用
- 上位机C#以太网连接三菱PLC
- c# 斑马打印机通信
- C#医院管理系统课程设计用
- C#计算器课程设计报告
- cyUsb C#USB通信 DLL
- plupload上传和uploadify上传c#
- C#程序打包
- C#图像处理源程序
- Asp.net在线考试系统源码及毕业设计论
- c#版的模拟文件系统
- C#发送接收短信
- C#完全手册中文高清.pdf版
- C#将excel导入到access,各种你们想要的
- ASP.net用户登录注册完整模块
- C#基础教程C# C# C# C#
- matlab绘图Figure嵌入C# Winform窗体中
- 由c#编写图书馆管理系统
- C#将word文件存入数据库与读取
- C#企业微信发送文本消息,发送图片给
- C#登录注册文档教程验证码.
评论
共有 条评论