资源简介
用C#写的苹果打字游戏,有苹果落下来,苹果上带有字母,按下键盘上的相应字母,苹果就消失了,这是个完整的程序,用VS2010写的,可以直接运行

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Media;
namespace 打字游戏
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int right = 0;
int wrong = 0;
string code1 = “a“;
string code2 = “b“;
string code3 = “w“;
int number = 0;
int time = 0;
private void Form1_KeyPress(object sender KeyPressEventArgs e)
{
int x = 0 x1 = 0 x2 = 0;
int y = 28 y1 = 28 y2 = 28;
if (number == 0)
{
x = new Random().Next(0 409);
x1 = new Random().Next(528 this.ClientRectangle.Width - 230);
}
if (number == 1)
{
x = new Random().Next(0 200);
x1 = new Random().Next(327 527);
x2 = new Random().Next(654 893);
}
//判断下降的速度高低
string receive1 = e.KeyChar.ToString();
if (receive1.Equals(code1))
{
right++;
//显示正确的个数
this.LabelScore1.Text = “当前正确数: “ + right.ToString();
this.panel1.Location = new Point(x y);
BOMB();
this.label1.Text = GetCode1().ToString();
//令高度从新开始
}
else if (receive1.Equals(code2))
{
right++;
//显示正确的个数
this.LabelScore1.Text = “当前正确数: “ + right.ToString();
this.panel2.Location = new Point(x1 y1);
BOMB();
this.label2.Text = GetCode2().ToString();
//令高度从新开始
}
else if (number == 1)
{
if (receive1.Equals(code3))
{
right++;
//显示正确的个数
this.LabelScore1.Text = “当前正确数: “ + right.ToString();
this.panel3.Location = new Point(x2 y2);
BOMB();
this.label3.Text = GetCode3().ToString();
//令高度从新开始
}
}
else
{
wrong++;
this.LabelLost1.Text = “ “ + “当前错误数: “ + wrong.ToString();
LOSS();
}
}
private void BOMB()
{
SoundPlayer player = new SoundPlayer(“1.wav“);
player.Play();
}
private void LOSS()
{
SoundPlayer player = new SoundPlayer(“2.WAV“);
player.Play();
}
public string GetCode1()
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 73786 2012-06-03 22:46 打字游戏\打字游戏\bin\Debug\1.wav
文件 431104 2012-10-17 13:07 打字游戏\打字游戏\bin\Debug\打字游戏.exe
文件 48640 2012-10-17 13:07 打字游戏\打字游戏\bin\Debug\打字游戏.pdb
文件 11600 2012-10-17 13:08 打字游戏\打字游戏\bin\Debug\打字游戏.vshost.exe
文件 490 2010-03-17 22:39 打字游戏\打字游戏\bin\Debug\打字游戏.vshost.exe.manifest
文件 7039 2012-06-17 16:56 打字游戏\打字游戏\Form1.cs
文件 16321 2012-06-17 16:56 打字游戏\打字游戏\Form1.Designer.cs
文件 504246 2012-06-17 16:56 打字游戏\打字游戏\Form1.resx
文件 4440 2012-06-17 08:31 打字游戏\打字游戏\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6275 2012-10-17 13:07 打字游戏\打字游戏\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 562 2012-10-17 13:07 打字游戏\打字游戏\obj\x86\Debug\GenerateResource.read.1.tlog
文件 398 2012-10-17 13:07 打字游戏\打字游戏\obj\x86\Debug\GenerateResource.write.1.tlog
文件 7897 2012-06-17 08:31 打字游戏\打字游戏\obj\x86\Debug\ResolveAssemblyReference.cache
文件 4608 2012-06-17 14:17 打字游戏\打字游戏\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 700 2012-10-17 13:08 打字游戏\打字游戏\obj\x86\Debug\打字游戏.csproj.FileListAbsolute.txt
文件 431104 2012-10-17 13:07 打字游戏\打字游戏\obj\x86\Debug\打字游戏.exe
文件 332231 2012-10-17 13:07 打字游戏\打字游戏\obj\x86\Debug\打字游戏.Form1.resources
文件 48640 2012-10-17 13:07 打字游戏\打字游戏\obj\x86\Debug\打字游戏.pdb
文件 82423 2012-06-17 16:34 打字游戏\打字游戏\obj\x86\Debug\打字游戏.Properties.Resources.resources
文件 493 2012-06-16 22:57 打字游戏\打字游戏\Program.cs
文件 1356 2012-06-16 22:57 打字游戏\打字游戏\Properties\AssemblyInfo.cs
文件 3113 2012-06-17 14:17 打字游戏\打字游戏\Properties\Resources.Designer.cs
文件 6199 2012-06-17 14:17 打字游戏\打字游戏\Properties\Resources.resx
文件 1097 2012-06-16 22:57 打字游戏\打字游戏\Properties\Settings.Designer.cs
文件 249 2012-06-16 22:57 打字游戏\打字游戏\Properties\Settings.settings
文件 53258 2012-06-17 14:17 打字游戏\打字游戏\Resources\苹果.png
文件 3796 2012-06-17 16:34 打字游戏\打字游戏\打字游戏.csproj
文件 878 2012-06-16 22:57 打字游戏\打字游戏.sln
..A..H. 18432 2012-10-17 13:08 打字游戏\打字游戏.suo
目录 0 2012-06-17 14:17 打字游戏\打字游戏\obj\x86\Debug\TempPE
............此处省略13个文件信息
- 上一篇:C#做的QQ仿QQ
- 下一篇:C#项目 员工管理信息系统
相关资源
- C# IP地址输入控件
- C#在一个窗口刷新更改另一个窗口控件
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
评论
共有 条评论