Beispiel #1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public Game()
        {
            FBuffer = new Bitmap(_ScreenWidth, _ScreenHeight);
            FPainter = Graphics.FromImage(FBuffer);
            FMap = new Map(_MapCols, _MapRows);

            FMonsters = new LinkedList<Monster>[1];
            FMonsters[0] = new LinkedList<Monster>();
        }
Beispiel #2
0
        private void Init()
        {
            Money = Config.InitialMoney;
            lastSpawn = DateTime.Now;
            spawn = 100;
            m = new Map(11, 6);
            st = DateTime.Now;
            Cannons = new List<Cannon>();

            Cannon1 c = new Cannon1(); c.position = new Vector2d(560, 80); Cannons.Add(c);

            c = new Cannon1(); c.position = new Vector2d(400, 200); Cannons.Add(c);
            c = new Cannon1(); c.position = new Vector2d(240, 100); Cannons.Add(c);
            c = new Cannon1(); c.position = new Vector2d(240, 180); Cannons.Add(c);
            c = new Cannon1(); c.position = new Vector2d(240, 240); Cannons.Add(c);

            Bullets = new List<Bullet>();

            Enemies = new LinkedList<Enemy>();
            Enemy a = new Enemy(); a.position = new Vector2d(0, 0);
            Enemies.AddFirst(a);
        }