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); }
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); } }
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; }
public override void init(ColorGame game) { backWinRed = game.Content.Load<Texture2D>("texture/game/RedWin"); backWinBlue = game.Content.Load<Texture2D>("texture/game/BlueWin"); }
public abstract void update(float delta, ColorGame game);
public abstract void init(ColorGame game);