Esempio n. 1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="LevelOne" /> class.
        /// </summary>
        public LevelOne()
        {
            // Backgrounds
              FileName = @"Assets\LevelOne.png";

              // Enemies
              for (int i = 0; i < 5; i++)
              {
            var ship = new Ship(this);
            int positionY = ship.Height + 10;
            int positionX = 150 + i * (ship.Width + 50);

            ship.Position = new Point(positionX, positionY);

            Actors.Add(ship);
              }

              for (int i = 0; i < 3; i++)
              {
              var ship2 = new Ship2(this);
              int positionY = ship2.Height + 50;
              int positionX = 230 + i * (ship2.Width + 50);

              ship2.Position = new Point(positionX, positionY);

              Actors.Add(ship2);
              }

              // Player
              Player = new PlayerShip(this);
              int playerPositionX = Size.Width / 2 - Player.Width / 2;
              int playerPositionY = Size.Height - Player.Height - 50;
              Player.Position = new Point(playerPositionX, playerPositionY);
              Actors.Add(Player);
        }
Esempio n. 2
0
 public EnemyBullet CreateEnemyBullet(Ship2 ship)
 {
     var enbullet = new EnemyBullet(Info);
     int positionY = ship.Position.Y + 26;
     int positionX = ship.Position.X + 12;
     enbullet.Position = new Point(positionX, positionY);
     enbullet.Load();
     return enbullet;
 }
Esempio n. 3
0
        public EnemyBullet CreateEnemyBullet(Ship2 ship)
        {
            var enbullet  = new EnemyBullet(Info);
            int positionY = ship.Position.Y + 26;
            int positionX = ship.Position.X + 12;

            enbullet.Position = new Point(positionX, positionY);
            enbullet.Load();
            return(enbullet);
        }
Esempio n. 4
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="LevelOne" /> class.
        /// </summary>
        public LevelOne()
        {
            // Backgrounds
            FileName = @"Assets\LevelOne.png";

            // Enemies
            for (int i = 0; i < 7; i++)
            {
                var ship = new Ship(this);
                int positionY = ship.Height + 10;
                int positionX = 150 + i*(ship.Width + 50);
                ship.Position = new Point(positionX, positionY);

                Actors.Add(ship);
            }
            // Enemies2
            for (int i = 0; i < 5; i++)
            {
                var ship2 = new Ship2(this);
                int positionY1 = ship2.Height + 30;
                int positionX1 = 180 + i * (ship2.Width + 50);

                ship2.Position = new Point(positionX1, positionY1);

                Actors.Add(ship2);
            }
            for (int i = 0; i < 4; i++)
            {
                var ship3 = new Ship3(this);
                int positionY = ship3.Height + 70;
                int positionX = 180 + i*(ship3.Width + 50);
                ship3.Position = new Point(positionX, positionY);

                //присваиваем значение Ship куда он должен лететь true false

                ship3.Movement = i < 2;
                Actors.Add(ship3);
            }

               // Player
            Player = new PlayerShip(this);
            int playerPositionX = Size.Width/2 - Player.Width/2;
            int playerPositionY = Size.Height - Player.Height - 50;
            Player.Position = new Point(playerPositionX, playerPositionY);
            Actors.Add(Player);

            var superm = new Superman(this);
            int positionYS = superm.Height + 10;
            int positionXS = superm.Width + 10;
            superm.Position = new Point(positionXS, positionYS);
            Actors.Add(superm);
        }
Esempio n. 5
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="LevelOne" /> class.
        /// </summary>
        public LevelOne()
        {
            // Backgrounds
            FileName = @"Assets\LevelOne.png";

            //// Enemies

            for (int i = 0; i < 5; i++)
            {
                var ship = new Ship(this);
                int positionY = ship.Height + 10;
                int positionX = 150 + i*(ship.Width + 50);
                ship.Position = new Point(positionX, positionY);
                Actors.Add(ship);
            }

            for (int i = 0; i < 1; i++)
            {
                var Thunderbolt = new Thunderbolt(this);
                int positionY = Thunderbolt.Height + 200;
                int positionX = 170 + i * (Thunderbolt.Width + 100);
                Thunderbolt.Position = new Point(positionX, positionY);
                Actors.Add(Thunderbolt);
            }
            for (int i = 0; i < 4; i++)
            {
                var ship2 = new Ship2(this);
                int positionY = ship2.Height + 50;
                int positionX = 170 + i * (ship2.Width + 100);
                ship2.Position = new Point(positionX, positionY);
                Actors.Add(ship2);
            }

            for (int i = 0; i < 3; i++)
            {
                var starOfDeathShip = new StarOfDeathShip(this);
                int positionY = starOfDeathShip.Height + 90;
                int positionX = 160 + i*(starOfDeathShip.Width + 120);
                starOfDeathShip.Position = new Point(positionX, positionY);
                Actors.Add(starOfDeathShip);
            }

            // Player
            Player = new PlayerShip(this);
            int playerPositionX = Size.Width/2 - Player.Width/2;
            int playerPositionY = Size.Height - Player.Height - 50;
            Player.Position = new Point(playerPositionX, playerPositionY);
            Actors.Add(Player);
        }