Пример #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 + 100;
            int positionX = 150 + i * (ship.Width + 70);

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

              if (i%2 == 0)
              {
              ship.m_styleoffly = StyleOfFly.Sin;
              }
              else
              {
              ship.m_styleoffly = StyleOfFly.Cos;
              }

            Actors.Add(ship);
              }
              //for (int i = 0; i < 7; i++)
              //{
              //    var spaceship = new Spaceship(this);
              //    int positionY = spaceship.Height + 50;
              //    int positionX = 110 + i * (spaceship.Width + 55);

              //    spaceship.Position = new Point(positionX, positionY);

              //    spaceship.m_styleoffly = StyleOfFly.Vector;

              //    Actors.Add(spaceship);
              //}

              //SuperEnemy
              var lightning = new Lightning(this);
              int posY = lightning.Height + 10;
              int posX = lightning.Width + 50;

              lightning.Position = new Point(posX, posY);

              Actors.Add(lightning);

              // 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);
        }
Пример #2
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);
              }
                InitTimer();

              //myship
              for (int i = 0; i < 4; i++)
              {
                  var myship = new MyShip(this);
                  int positionY = myship.Height + 50;
                  int positionX = 150 + i * (myship.Width + 50);

                  myship.Direction = i < 2;

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

                  Actors.Add(myship);
              }

              //Lightning
              var Lightning = new Lightning(this);
              int lightningPositionX = Size.Width / 2 - Lightning.Width / 2;
              int lightningPositionY = Size.Height/2 - Lightning.Height/2;

              Lightning.Position = new Point(lightningPositionX, lightningPositionY);
              Actors.Add(Lightning);

              // 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);
        }