예제 #1
0
 private void changeFocus(GameTime gameTime)
 {
     if (gameTime.TotalGameTime.Subtract(BombermanGame.lastDieTime).Seconds > 30)
     {
         BombermanGame.lastDieTime = gameTime.TotalGameTime;
         if (bomberman is BombermanPlayerOne)
         {
             bomberman = BombermanPlayerTwo.getInstance();
         }
         else
         {
             bomberman = BombermanPlayerOne.getInstance();
         }
     }
 }
예제 #2
0
        public EnemyEntity(Rectangle rectangle) : base(imageRoute + "Down/1", rectangle)
        {
            int speed = 1;

            mapKeys = new Dictionary <Keys, int>();

            mapKeys.Add(Keys.Up, -speed);
            mapKeys.Add(Keys.Down, speed);
            mapKeys.Add(Keys.Right, speed);
            mapKeys.Add(Keys.Left, -speed);

            imagesXDirections = new Dictionary <Keys, Dictionary <int, Texture2D> >();
            imagesXDirections.Add(Keys.Up, base.buildImagesRoutes(imageRoute + "Up/"));
            imagesXDirections.Add(Keys.Down, base.buildImagesRoutes(imageRoute + "Down/"));
            imagesXDirections.Add(Keys.Left, base.buildImagesRoutes(imageRoute + "Left/"));
            imagesXDirections.Add(Keys.Right, base.buildImagesRoutes(imageRoute + "Right/"));

            bomberman = BombermanPlayerOne.getInstance();
        }