Пример #1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="LevelOne" /> class.
        /// </summary>
        public LevelTwo()
        {
            // Backgrounds
              FileName = @"Assets\LevelOne.png";
            m_gameTimer = new Stopwatch();
            m_gameTimer.Start();

              // Enemies
              for (int i = 0; i < 4; i++)
              {
              var ship = new Enemy1ForLevelTwo(this);
            int positionY = ship.Height + 30;
            int positionX = 150 + i * (ship.Width + 80);

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

            Actors.Add(ship);
              }

              // 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
 public EnemyBullet NewEnemyBullet(Enemy1ForLevelTwo spaceship)
 {
     EnemyBullet bullet = new EnemyBullet(Info);
     int positionY = spaceship.Position.Y + 30;
     int positionX = spaceship.Position.X + 15;
     bullet.Position = new Point(positionX, positionY);
     bullet.Load();
     return bullet;
 }