资源简介
使用c#开发的flappybird小游戏。功能还没有完全实现。有需要的拿去用吧。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using flappybird.Properties;
namespace flappybird
{
public class Bird : GameObj
{
///
/// 各种小鸟形态数组
///
private static Image[] imgs ={
Properties.Resources.bird_blue_0
Properties.Resources.bird_blue_1
Properties.Resources.bird_blue_2
};
///
/// 当前绘制的小鸟形态的索引
///
public int BirdIndex { get; set; }
///
/// 存储当前下落速度
///
public float Speed { get; set; }
///
/// 存储已下落持续时间
///
public float Time { get; set; }
private static Bird bird = null;
///
/// 单例模式,确保只实例化一个Bird对象
///
///
public static Bird GetSingleBird()
{
if (bird == null)
{
bird = new Bird(100 200 0);
}
return bird;
}
///
/// 调用父类的构造函数
///
///
///
///
private Bird(int x int y int birdIndex)
: base(x y imgs[0].Height imgs[0].Width)
{
this.BirdIndex = birdIndex;
this.Time = 10f;
this.Speed = 0f;
}
///
/// 重写父类的抽象Draw方法
///
public override void Draw(Graphics g)
{
switch (this.BirdIndex)
{
case 0:
g.DrawImage(imgs[0] this.X this.Y);
break;
case 1:
g.DrawImage(imgs[1] this.X this.Y);
break;
case 2:
g.DrawImage(imgs[2] this.X this.Y);
break;
default:
break;
}
this.BirdIndex++;
this.BirdIndex %= 3;
}
///
/// 重写父类的抽象Move方法
///
public override void Move()
{
this.Y = this.Y <= 60 ? 0 : this.Y - 60;
//this.Y -= 30;
}
///
/// 获取图形区域,用于碰撞检测
///
///
public static Rectangle GetRectangle()
{
return new Rectangle(bird.X bird.Y Resources.bird_blue_0.Width Resources.bird_blue_0.Height);
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 214016 2014-12-11 13:52 flappybird\bin\Debug\flappybird.exe
文件 48640 2014-12-11 13:52 flappybird\bin\Debug\flappybird.pdb
文件 22656 2014-12-13 13:27 flappybird\bin\Debug\flappybird.vshost.exe
文件 490 2010-03-17 22:39 flappybird\bin\Debug\flappybird.vshost.exe.manifest
文件 3016 2014-12-13 13:30 flappybird\Bird.cs
文件 4786 2014-12-09 23:34 flappybird\flappybird.csproj
文件 4755 2014-12-10 02:18 flappybird\Form1.cs
文件 4144 2014-12-10 12:07 flappybird\Form1.Designer.cs
文件 6574 2014-12-10 12:07 flappybird\Form1.resx
文件 702 2014-12-08 21:55 flappybird\GameObj.cs
文件 1165 2014-12-09 00:58 flappybird\Gravity.cs
文件 1417 2014-12-09 00:15 flappybird\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 8247 2014-12-09 22:26 flappybird\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 938 2014-12-13 13:27 flappybird\obj\Debug\flappybird.csproj.FileListAbsolute.txt
文件 1533 2014-12-11 13:52 flappybird\obj\Debug\flappybird.csproj.GenerateResource.Cache
文件 2145 2014-12-08 21:51 flappybird\obj\Debug\flappybird.csprojResolveAssemblyReference.cache
文件 214016 2014-12-11 13:52 flappybird\obj\Debug\flappybird.exe
文件 180 2014-12-11 13:52 flappybird\obj\Debug\flappybird.Form1.resources
文件 48640 2014-12-11 13:52 flappybird\obj\Debug\flappybird.pdb
文件 198495 2014-12-09 23:34 flappybird\obj\Debug\flappybird.Properties.Resources.resources
文件 6144 2014-12-08 17:27 flappybird\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 2071 2014-12-10 01:42 flappybird\Pipe.cs
文件 491 2014-12-08 17:02 flappybird\Program.cs
文件 1362 2014-12-08 17:02 flappybird\Properties\AssemblyInfo.cs
文件 7552 2014-12-08 17:27 flappybird\Properties\Resources.Designer.cs
文件 9105 2014-12-08 17:27 flappybird\Properties\Resources.resx
文件 1097 2014-12-08 17:02 flappybird\Properties\Settings.Designer.cs
文件 249 2014-12-08 17:02 flappybird\Properties\Settings.settings
文件 45166 2014-12-08 17:06 flappybird\Resources\atlas.png
文件 47891 2014-12-08 17:06 flappybird\Resources\background.png
............此处省略22个文件信息
相关资源
- 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 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
评论
共有 条评论