Exemplo 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);
 }
Exemplo 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);
            }
        }
Exemplo 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;
 }
Exemplo 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");
 }
Exemplo n.º 5
0
 public abstract void update(float delta, ColorGame game);
Exemplo n.º 6
0
 public abstract void init(ColorGame game);