Пример #1
0
 public static BombermanPlayerOne getInstance(bool requireNewInstance = false)
 {
     if (bomberManPlayerOne == null || requireNewInstance)
     {
         BombermanPlayerOne.bomberManPlayerOne = new BombermanPlayerOne(new Rectangle(85, 65, 40, 35));
     }
     return(BombermanPlayerOne.bomberManPlayerOne);
 }
Пример #2
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();
         }
     }
 }
Пример #3
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();
        }