Esempio n. 1
0
 public override void update(float delta, ColorGame game)
 {
     KeyboardState keyboard = Keyboard.GetState();
     Keys[] pressed = keyboard.GetPressedKeys();
     foreach (Keys key in pressed)
         if (key == Keys.Escape)
             game.enterState(GameType.MainMenu);
 }
Esempio n. 2
0
        public override void update(float delta, ColorGame game)
        {
            ResGen.update(delta);
            redPlayer.update(delta);
            bluePlayer.update(delta);

            for (int i = 0; i < size; i++)
                for (int j = 0; j < size; j++)
                    tiles[i, j].update(delta);

            KeyboardState keyboard = Keyboard.GetState();
            Keys[] pressed = keyboard.GetPressedKeys();
            foreach (Keys key in pressed)
                if (key == Keys.Escape)
                    game.enterState(GameType.MainMenu);

            if (DateTime.Now.Second - startTime.Second == 0 && DateTime.Now.Minute - startTime.Minute == time) {
                EndOfGameState.redWin = (redCounter.getPer(tileCount) > blueCounter.getPer(tileCount));
                game.enterState(GameType.EndOfGame);
            }
        }
Esempio n. 3
0
 public override void init(ColorGame game)
 {
     floorTex = game.Content.Load<Texture2D>("texture/game/floor");
     wallTex = game.Content.Load<Texture2D>("texture/game/wall");
     redPlayerTex = game.Content.Load<Texture2D>("texture/game/RedPlayer");
     bluePlayerTex = game.Content.Load<Texture2D>("texture/game/BluePlayer");
     interTex = game.Content.Load<Texture2D>("texture/game/interface");
     Fire.setTexture(game.Content.Load<Texture2D>("texture/game/buildings/fire"));
     font = game.Content.Load<SpriteFont>("Font/SpriteFont");
     ResGen = new ResourceGenerator(game.Content);
     content = game.Content;
 }
Esempio n. 4
0
 public override void init(ColorGame game)
 {
     backWinRed = game.Content.Load<Texture2D>("texture/game/RedWin");
     backWinBlue = game.Content.Load<Texture2D>("texture/game/BlueWin");
 }
Esempio n. 5
0
 public abstract void update(float delta, ColorGame game);
Esempio n. 6
0
 public abstract void init(ColorGame game);