C#飞机大战程序设计

简介: C#飞机大战程序设计

1.课程设计的目的


1)通过本次课程设计,熟练掌握开发语言C#和开发环境。开发语言的熟练需要通过编写一定长度的代码(1000~2000行代码)才能达到,开发环境的熟练需要反复的程序调试训练。


2)加深对软件工程的理解,训练编写程序的良好习惯。包括:认真编写需求分析文档、做好系统功能设计、学会自己进行程序的算法、数据结构设计。


3)培养良好的程序设计风格(模块划分、接口设计、函数和变量命名规则)和习惯(程序备份、版本更新与控制),提高软件测试、调试的能力与技巧。


4)课程设计旨在让同学们通过参与小团队开发一个较为完整的项目,学会与人相处、学会合作,认识团队协作的重要性,从而认识.NET平台,掌握使用C# 面向对象开发应用程序所需的知识和技能,锻炼学生在程序开发中的思维逻辑能力,提高用户的动手能力,并初步具备利用C#开发Windows应用程序的能力,为从事信息处理工作做好准备。


一、总体设计


1.1游戏介绍


飞机大战是一款单人电脑控制类小游戏,游戏的目的让玩家体验游戏中的星空,击杀敌人而获得积分,玩家的生命值可以无限,在游戏中玩家击杀不同类型的敌机可以获得相应的得分而喜悦,以消除人们日常疲劳。


二. 详细设计

2.1 GameObject(父类)


2.1.1属性


①x、y坐标,游戏对象的Width以及Height。

②游戏对象移动的速度speed、方向Direction、生命值life。

2.1.2方法

①Move()虚方法

②Draw()抽象方法

③GetRectangle()


2.2 BackGround(背景类)


2.2.1首先应该将背景图片导入,因为我们需要将背景图片绘制到窗体上。

2.2.2写构造函数去调用父类GameObject进行初始化.

2.2.3背景左边坐标改变后,将背景图像不停地绘制到我们的窗体上。

2.3 SingleObject(单例类)

2.3.1存储背景在游戏中的对象。

2.3.2存储玩家飞机在游戏中的对象。

2.3.3声明一个集合对象用来存储玩家子弹。

2.3.4声明一个集合对象来存储敌人飞机对象。

2.3.5声明一个集合来存放我们敌人的子弹。

2.3.6声明一个集合来存储敌人爆炸的对象。

2.3.7声明一个集合来存储玩家爆炸的对象。

2.3.8写一个函数,将我们创建的游戏对象,添加到我们的窗体中。

2.3.9将游戏对象从游戏中移除。

2.3.10记录玩家的分数。

1.4 PlaneFather(飞机的父类)

2.4.1声明一个字段存储飞机的图片

2.4.2我们飞机的父类不需要 重写父类的Draw函数,因为我们玩家飞机跟敌人飞机在绘制自己到窗体的时候 方式各不一样

2.4.3提供一个判断是否死亡的抽象函数 具体怎么死亡 又子类自己去决定

1.5 PlaneHero(玩家飞机的类)

2.5.1导入玩家飞机的图片 存储到字段中

2.5.2必须要重写GameObject中抽象函数Draw,将自己绘制到屏幕上

2.5.3提供一个开炮的函数

2.6 PlaneEnemy(敌人飞机的类)

2.6.1设计敌人飞机类,导入三架敌人飞机的图片。

2.6.2初始化敌人飞机。

2.6.3 碰撞检测。

2.6.3播放飞机爆炸后应该显示的图片。

2.7 ZiDan(子弹的父类)

2.7.1 HeroZiDan(玩家子弹类)。

2.7.2 EnemyZiDan敌人子弹类。

2.8 Boom(爆炸的父类)

2.8.1 HeroBoom(玩家爆炸类)

2.8.2 EnemyBoom(敌人爆炸类)

2.9 实现玩家飞机跟敌人飞机的碰撞检测。

2.10计分的功能

2.10.1、在单例类中声明属性来记录分数。

2.10.2当敌人爆炸的时候,给玩家相应的增加分数,根据敌人飞机不同的类型,增加不同的分数。

0–100分 1–200分 2–300分

2.10.3、将分数绘制到我们的游戏窗体中


三.codes


//Backgroud.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 打飞机.Properties;
namespace 打飞机
{
class BackGround : GameObject
{
//首先应该将背景图片导入 因为我们需要将背景图片绘制到窗体上
private static Image imgBG = Resources.background;
//写构造函数去调用父类GameObject的构造函数
public BackGround(int x, int y, int speed)
: base(x, y, imgBG.Width, imgBG.Height, speed, 0, Direction.Down)
{ }
        public override void Draw(Graphics g)
        {
            this.Y += this.Speed;
            if (this.Y == 0)
            {
                this.Y = -850;
            }
            //坐标改变完成后 ,将背景图像不停的绘制到我们窗体中
            g.DrawImage(imgBG, this.X, this.Y);
        }
    }
}
//boom.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 打飞机
{
    abstract class Boom : GameObject
    {
        //只需要调用父类的构造函数
        //在播放爆炸图片的时候 只需要知道爆炸图片应该播放的坐标就O啦
        public Boom(int x, int y)
            : base(x, y)
        {
        }
    }
}
//EnemyBoom.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 打飞机.Properties;
namespace 打飞机
{
    class EnemyBoom : Boom
    {
        //需要倒入每种飞机爆炸时候的图片
        private Image[] imgs1 = {
                                    Resources.enemy0_down11,
                                    Resources.enemy0_down2,
                                    Resources.enemy0_down3,
                                    Resources.enemy0_down4
                                };
        private Image[] imgs2 = { 
                                Resources.enemy1_down11,
                                Resources.enemy1_down2,
                                Resources.enemy1_down3,
                                Resources.enemy1_down4
                                };
        private Image[] imgs3 = { 
                                    Resources.enemy2_down11,
                                    Resources.enemy2_down2,
                                    Resources.enemy2_down3,
                                    Resources.enemy2_down4,
                                    Resources.enemy2_down5,
                                    Resources.enemy2_down6
                                };
        //在爆炸的时候 我们需要知道当前爆炸的是哪家飞机
        //根据敌人飞机的类型来播放对应的爆炸图片
        public int Type
        {
            get;
            set;
        }
        public EnemyBoom(int x, int y,int type)
            : base(x, y)
        {
            this.Type = type;
        }
        public override void Draw(Graphics g)
        {
            //在将爆炸图片绘制到窗体的时候 需要根据当前飞机的类型来绘制
            switch (this.Type)
            { 
                case 0:
                    for (int i = 0; i < imgs1.Length; i++)
                    {
                        g.DrawImage(imgs1[i], this.X, this.Y);
                    }
                    break;
                case 1:
                    for (int i = 0; i < imgs2.Length; i++)
                    {
                        g.DrawImage(imgs2[i], this.X, this.Y);
                    }
                    break;
                case 2:
                    for (int i = 0; i < imgs3.Length; i++)
                    {
                        g.DrawImage(imgs3[i], this.X, this.Y);
                    }
                    break;
            }
            //爆炸图片播放完成后 就应该销毁
            SingleObject.GetSingle().RemoveGameObject(this);
        }
    }
}
//EnemyZiDan.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 打飞机.Properties;
namespace 打飞机
{
    class EnemyZiDan : ZiDan
    {
        private static Image imgHero = Resources.bullet11;
        public EnemyZiDan(PlaneFather pf, int speed, int power)
            : base(pf, imgHero, speed, power)
        { }
    }
}
//GameObject.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 打飞机
{
    enum Direction
    {
        Up,
        Down,
        Left,
        Right
    }
    /// <summary>
    /// 这是所有游戏对象的父类,封装着所有子类所共有的成员
    /// </summary>
    abstract class GameObject
    {
        #region 横纵坐标、宽度、高度、速度、生命值、方向
        public int X
        {
            get;
            set;
        }
        public int Y
        {
            get;
            set;
        }
        public int Width
        {
            get;
            set;
        }
        public int Height
        {
            get;
            set;
        }
        public int Speed
        {
            get;
            set;
        }
        public int Life
        {
            get;
            set;
        }
        public Direction Dir
        {
            get;
            set;
        }
        #endregion
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="speed"></param>
        /// <param name="life"></param>
        /// <param name="dir"></param>
        public GameObject(int x, int y, int width, int height, int speed, int life, Direction dir)
        {
            this.X = x;
            this.Y = y;
            this.Width = width;
            this.Height = height;
            this.Speed = speed;
            this.Life = life;
            this.Dir = dir;
        }
        //每个游戏对象在使用GDI+对象绘制自己到窗体的时候,绘制的方式都各不一样、。
        //所以我们需要在父类中提供一个绘制对象的抽象函数
        public abstract void Draw(Graphics g);
        //在提供一个用于碰撞检测的函数 返回当前游戏对象的矩形
        public Rectangle GetRectangle()
        {
            return new Rectangle(this.X, this.Y, this.Width, this.Height);
        }
        public GameObject(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }
        /// <summary>
        /// 移动的虚方法,每个子类如果有不一样的地方,则重写
        /// </summary>
        public virtual void Move()
        {
            //根据游戏对象的方向进行移动
            switch (this.Dir)
            { 
                case Direction.Up:
                    this.Y -= this.Speed;
                    break;
                case Direction.Down:
                    this.Y += this.Speed;
                    break;
                case Direction.Left:
                    this.X -= this.Speed;
                    break;
                case Direction.Right:
                    this.X += this.Speed;
                    break;
            }
            //移动完成后 判断一下游戏对象是否超出了窗体
            if (this.X <= 0)
            {
                this.X = 0;
            }
            if (this.X >= 400)
            {
                this.X = 400;
            }
            if (this.Y <= 0)
            {
                this.Y = 0;
            }
            if (this.Y >= 700)
            {
                this.Y = 700;
            }
        }
    }
}
//HeroBoom.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 打飞机.Properties;
namespace 打飞机
{
    class HeroBoom:Boom
    {
        private Image imgs = Resources.hero_blowup_n1;
        public HeroBoom(int x, int y)
            : base(x, y)
        { }
        public override void Draw(Graphics g)
        {
            g.DrawImage(imgs, this.X-40, this.Y-25);
            //绘制完成后 应该将爆炸的图片移除
            SingleObject.GetSingle().RemoveGameObject(this);
        }
    }
}
//HeroZiDan.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 打飞机.Properties;
namespace 打飞机
{
    class HeroZiDan : ZiDan
    {
        private static Image imgHero = Resources.bullet1;
        public HeroZiDan(PlaneFather pf, int speed, int power)
            : base(pf, imgHero, speed, power)
        {
        }
    }
}
//PlaneEnemy.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 打飞机.Properties;
namespace 打飞机
{
    class PlaneEnemy : PlaneFather
    {
        private static Image img1 = Resources.enemy0;//最小的飞机
        private static Image img2 = Resources.enemy1;//中间的飞机
        private static Image img3 = Resources.enemy2;//最大的飞机
        public PlaneEnemy(int x, int y, int type)
            : base(x, y, GetImage(type), GetSpeed(type), GetLife(type), Direction.Down)
        {
            this.EnemyType = type;
        }
        //因为每一架飞机的大小、生命值、速度都不一样,所以我们需要声明一个标示来标记当前到底属于哪架飞机
        //0--最小的飞机  1--中间的飞机 2--最大的飞机
        public int EnemyType
        {
            get;
            set;
        }
        //下面需要根据我们飞机的类型 分别的写三个函数 用于返回飞机的图片 飞机的速度 飞机的生命值
        //根据飞机的类型 返回对应的图片
        public static Image GetImage(int type)
        {
            //静态函数中只能访问静态成员
            switch (type)
            {
                case 0:
                    return img1;
                case 1:
                    return img2;
                case 2:
                    return img3;
            }
            return null;
        }
        //根据飞机的类型  返回对应的生命值
        public static int GetLife(int type)
        {
            switch (type)
            {
                case 0:
                    return 1;
                case 1:
                    return 2;
                case 2:
                    return 3;
            }
            return 0;
        }
        //根据飞机的类型 返回对应的速度
        public static int GetSpeed(int type)
        {
            switch (type)
            {
                case 0:
                    return 3;
                case 1:
                    return 4;
                case 2:
                    return 5;
            }
            return 0;
        }
        //我们需要重写父类中的Draw函数 将自己绘制到Form窗体上
        public override void Draw(Graphics g)
        {
            //随着将敌人飞机绘制出来 就让我们的敌人飞机 开始移动
            this.Move();
            //也需要根据不同的飞机类型 来绘制不同的飞机
            switch (this.EnemyType)
            {
                case 0:
                    g.DrawImage(img1, this.X, this.Y);
                    break;
                case 1:
                    g.DrawImage(img2, this.X, this.Y);
                    break;
                case 2:
                    g.DrawImage(img3, this.X, this.Y);
                    break;
            }
        }
        //重写父类中Move函数
        public override void Move()
        {
            //根据游戏对象的方向进行移动
            switch (this.Dir)
            {
                case Direction.Up:
                    this.Y -= this.Speed;
                    break;
                case Direction.Down:
                    this.Y += this.Speed;
                    break;
                case Direction.Left:
                    this.X -= this.Speed;
                    break;
                case Direction.Right:
                    this.X += this.Speed;
                    break;
            }
            if (this.X <= 0)
            {
                this.X = 0;
            }
            if (this.X >= 400)
            {
                this.X = 400;
            }
            if (this.Y <= 0)
            {
                this.Y = 0;
            }
            if (this.Y >= 780)
            {
                this.Y = 1400;//到达窗体底端的时候 让敌人飞机离开窗体
                //同时 当敌人飞机离开窗体的时候 我们应该销毁当前敌人飞机
                SingleObject.GetSingle().RemoveGameObject(this);
            }
            //当敌人的飞机类型是0,并且纵坐标>=某个值之后 我们不停的更换他的横坐标
            if (this.EnemyType == 0 && this.Y >= 200)
            {
                if (this.X >= 0 && this.X <= 220)
                {
                    //表示当前的小飞机在左边的范围内
                    //增加当前飞机的X值
                    this.X += r.Next(0, 50);
                }
                else
                {
                    this.X -= r.Next(0, 50);
                }
            }
            else//飞机类型是1或者2
            { 
                //如果是大飞机的话 就不让你改变横坐标了 而是让你加快速度
                this.Speed += 1;
            }
            //百分之十的概率发射子弹
            if (r.Next(0, 100) > 92)
            {
                Fire();
            }
        }
        public void Fire()
        {
            SingleObject.GetSingle().AddGameObject(new EnemyZiDan(this, 20, 1));
        }
        static Random r = new Random();
        //判断敌人是否死亡
        public override void IsOver()
        {
            if (this.Life <= 0)
            { 
                //敌人飞机坠毁 应该将敌人飞机从游戏中移除
                SingleObject.GetSingle().RemoveGameObject(this);
                //播放敌人爆炸的图片  
                SingleObject.GetSingle().AddGameObject(new EnemyBoom(this.X, this.Y,this.EnemyType));
                //敌人发生了爆炸 给玩家加分
                //需要根据不同的敌人类型 添加不同的分数
                switch (this.EnemyType)
                { 
                    case 0:
                        //获得单例中记录玩家分数的属性
                        SingleObject.GetSingle().Score += 100;
                        break;
                    case 1:
                        SingleObject.GetSingle().Score += 200;
                        break;
                    case 2:
                        SingleObject.GetSingle().Score += 300;
                        break;
                }
            }
        }
    }
}
//PlaneFather.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 打飞机
{
    /// <summary>
    /// 飞机的父类 抽象类
    /// </summary>
    abstract class PlaneFather : GameObject
    {
        private Image imgPlane;//声明一个字段存储飞机的图片
        public PlaneFather(int x, int y, Image img, int speed, int life, Direction dir)
            : base(x, y, img.Width, img.Height, speed, life, dir)
        {
            this.imgPlane = img;
        }
        //我们飞机的父类不需要 重写父类的Draw函数,因为我们玩家飞机跟敌人飞机在绘制自己到窗体的时候 方式各不一样
        //提供一个判断是否死亡的抽象函数 具体怎么死亡 又子类自己去决定
        public abstract void IsOver();
    }
}
//Programe.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 打飞机
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form2());
        }
    }
}
//SingleObject.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 打飞机
{
    class SingleObject
    {
        //单例设计模式
        //1、构造函数私有化
        private SingleObject()
        { }
        //2、声明全局唯一的对象
        private static SingleObject _single = null;
        //3、提供一个静态函数用于返回一个唯一的对象
        public static SingleObject GetSingle()
        {
            if (_single == null)
            {
                _single = new SingleObject();
            }
            return _single;
        }
        //存储的背景在游戏中唯一的对象
        public BackGround BG
        {
            get;
            set;
        }
        //存储的是玩家飞机在游戏中唯一的对象
        public PlaneHero PH
        {
            get;
            set;
        }
        //声明一个集合对象用来存储玩家子弹
        List<HeroZiDan> listHeroZiDan = new List<HeroZiDan>();
        //声明一个集合对象来存储敌人飞机对象
        public List<PlaneEnemy> listPlaneEnemy = new List<PlaneEnemy>();
        //声明一个集合来存放我们敌人的子弹
        List<EnemyZiDan> listEnemyZiDan = new List<EnemyZiDan>();
        //声明一个集合来存储敌人爆炸的对象
        List<EnemyBoom> listEnemyBoom = new List<EnemyBoom>();
        //声明一个集合来存储玩家爆炸的对象
        List<HeroBoom> listHeroBoom = new List<HeroBoom>();
        //下面呢,我要写一个函数,将我们创建的游戏对象,添加到我们的窗体中
        public void AddGameObject(GameObject go)
        {
            if (go is BackGround)
            {
                this.BG = go as BackGround;
            }
            else if (go is PlaneHero)
            {
                this.PH = go as PlaneHero;
            }
            else if (go is HeroZiDan)
            {
                listHeroZiDan.Add(go as HeroZiDan);
            }
            else if (go is PlaneEnemy)
            {
                listPlaneEnemy.Add(go as PlaneEnemy);
            }
            else if (go is EnemyBoom)
            {
                listEnemyBoom.Add(go as EnemyBoom);
            }
            else if(go is EnemyZiDan)
            {
                listEnemyZiDan.Add(go as EnemyZiDan);
            }
            else if (go is HeroBoom)
            {
                listHeroBoom.Add(go as HeroBoom);
            }
        }
        //将游戏对象从游戏中移除
        public void RemoveGameObject(GameObject go)
        {
            //移除飞机
            if (go is PlaneEnemy)
            {
                listPlaneEnemy.Remove(go as PlaneEnemy);
            }
            //玩家子弹打出边界后 将玩家子弹同样的移除
            else if (go is HeroZiDan)
            {
                listHeroZiDan.Remove(go as HeroZiDan);
            }
            else if (go is EnemyBoom)
            {
                listEnemyBoom.Remove(go as EnemyBoom);
            }
            else if (go is EnemyZiDan)
            {
                listEnemyZiDan.Remove(go as EnemyZiDan);
            }
            else if (go is HeroBoom)
            {
                listHeroBoom.Remove(go as HeroBoom);
            }
        }
        public void Draw(Graphics g)
        {
            this.BG.Draw(g);//向窗体中绘制的是背景
            this.PH.Draw(g);//绘制的是玩家飞机
            for (int i = 0; i < listHeroZiDan.Count; i++)
            {
                listHeroZiDan[i].Draw(g);
            }
            for (int i = 0; i < listPlaneEnemy.Count; i++)
            {
                listPlaneEnemy[i].Draw(g);
            }
            for (int i = 0; i < listEnemyBoom.Count; i++)
            {
                listEnemyBoom[i].Draw(g);
            }
            for (int i = 0; i < listEnemyZiDan.Count; i++)
            {
                listEnemyZiDan[i].Draw(g);
            }
            for (int i = 0; i < listHeroBoom.Count; i++)
            {
                listHeroBoom[i].Draw(g);
            }
        }
        //记录玩家的分数
        public int Score
        {
            get;
            set;
        }
        public void PZJC()
        {
            #region 判断玩家的子弹是否打到了敌人的身上
            for (int i = 0; i < listHeroZiDan.Count; i++)
            {
                for (int j = 0; j < listPlaneEnemy.Count; j++)
                {
                    if (listHeroZiDan[i].GetRectangle().IntersectsWith(listPlaneEnemy[j].GetRectangle()))
                    { 
                        //如果条件成立 则说明发生了碰撞
                        //也就是玩家的子弹打到了敌人的身上
                        //敌人的生命值应该减少
                        listPlaneEnemy[j].Life -= listHeroZiDan[i].Power;
                        //生命值减少后 应该判断敌人是否死亡
                        listPlaneEnemy[j].IsOver();
                        //玩家子弹打到了敌人身上后 应该将玩家子弹销毁
                        listHeroZiDan.Remove(listHeroZiDan[i]);
                        break;
                    }
                }
            }
            #endregion
            #region 判断敌人的子弹是否打到了玩家身上
            for (int i = 0; i < listEnemyZiDan.Count; i++)
            {
                if (listEnemyZiDan[i].GetRectangle().IntersectsWith(this.PH.GetRectangle()))
                { 
                    //让玩家发生爆炸 但不死亡
                    this.PH.IsOver();
                    break;
                }
            }
            #endregion
            #region 判断玩家是否和敌人飞机发生相撞
            for (int i = 0; i < listPlaneEnemy.Count; i++)
            {
                if (listPlaneEnemy[i].GetRectangle().IntersectsWith(this.PH.GetRectangle()))
                {
                    listPlaneEnemy[i].Life = 0;
                    listPlaneEnemy[i].IsOver();
                    break;
                }
            }
            #endregion
        }
    }
}
//ZiDan.cs
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 打飞机
{
    //子弹的父类
    class ZiDan : GameObject
    {
        private Image imgZiDan;//存储子弹图片
        //记录一下子弹的威力
        public int Power
        {
            get;
            set;
        }
        public ZiDan(PlaneFather pf, Image img, int speed, int power)
            : base(pf.X + pf.Width / 2 - 40, pf.Y + pf.Height / 2 - 50, img.Width, img.Height, speed, 0, pf.Dir)
        {
            this.imgZiDan = img;
            this.Power = power;
        }
        //重写GameObject的抽象成员
        public override void Draw(Graphics g)
        {
            this.Move();
            g.DrawImage(imgZiDan, this.X, this.Y, this.Width / 3 * 2, this.Height / 3 * 2);
        }
        public override void Move()
        {
            switch (this.Dir)
            {
                case Direction.Up:
                    this.Y -= this.Speed;
                    break;
                case Direction.Down:
                    this.Y += this.Speed;
                    break;
            }
            //子弹发出后 控制一下子弹的坐标
            if (this.Y <= 0)
            {
                this.Y = -100;
                //在游戏中移除子弹对象
            }
            if (this.Y >= 780)
            {
                this.Y = 1000;
                //在游戏中移除子弹对象
            }
        }
    }
}
目录
相关文章
|
8月前
|
C# 数据库 Windows
C# OOP程序设计目录
C# OOP程序设计目录
24 0
|
5月前
|
编译器 C# Windows
C#高级程序设计Type类
C#高级程序设计Type类
31 0
|
5月前
|
SQL 关系型数据库 MySQL
C#程序设计案例开发教程
C#程序设计案例开发教程
51 0
C#面向对象程序设计课程实验五:实验名称:C#面向对象技术
C#面向对象程序设计课程实验五:实验名称:C#面向对象技术
C#面向对象程序设计课程实验五:实验名称:C#面向对象技术
C#面向对象程序设计课程实验四:实验名称:C#面向对象程序设计基础
C#面向对象程序设计课程实验四:实验名称:C#面向对象程序设计基础
C#面向对象程序设计课程实验四:实验名称:C#面向对象程序设计基础
|
存储 算法 C#
C#面向对象程序设计课程实验三:实验名称:C#数组和集合
C#面向对象程序设计课程实验三:实验名称:C#数组和集合
C#面向对象程序设计课程实验三:实验名称:C#数组和集合
|
C# Windows 容器
C#面向对象程序设计课程实验二: 实验名称:Windows 窗体程序
C#面向对象程序设计课程实验二: 实验名称:Windows 窗体程序
C#面向对象程序设计课程实验二: 实验名称:Windows 窗体程序
C#面向对象程序设计课程实验一:实验名称:C#语言基础、程序流程控制
C#面向对象程序设计课程实验一:实验名称:C#语言基础、程序流程控制
C#面向对象程序设计课程实验一:实验名称:C#语言基础、程序流程控制
|
并行计算 Java C#
C#编程学习14:多线程并行程序设计及示例代码(下)
C#编程学习14:多线程并行程序设计及示例代码
C#编程学习14:多线程并行程序设计及示例代码(下)
|
SQL 开发框架 .NET
C#编程学习14:多线程并行程序设计及示例代码(上)
C#编程学习14:多线程并行程序设计及示例代码
C#编程学习14:多线程并行程序设计及示例代码(上)