public override void Control(GameTime gameTime) { inputManager.Update(); if (inputManager.IsInputDown(keyMap[PlayerAction.MoveUp])) { player.MoveUp(gameTime); } if (inputManager.IsInputDown(keyMap[PlayerAction.MoveDown])) { player.MoveDown(gameTime); } if (inputManager.IsInputDown(keyMap[PlayerAction.MoveLeft])) { player.MoveLeft(gameTime); } if (inputManager.IsInputDown(keyMap[PlayerAction.MoveRight])) { player.MoveRight(gameTime); } if (inputManager.IsInputUp(Inputs.Up) && inputManager.IsInputUp(Inputs.Down)) { player.Stop(1, 0); } if (inputManager.IsInputUp(Inputs.Left) && inputManager.IsInputUp(Inputs.Right)) { player.Stop(0, 1); } }
public override void Control(GameTime gameTime) { inputManager.Update(); if (inputManager.IsInputDown(keyMap[WorldAction.AddTile])) { world.AddTile(inputManager.mouseX, inputManager.mouseY, 64, 64, 1); } if (inputManager.IsInputDown(keyMap[WorldAction.RemoveTile])) { world.RemoveTile(inputManager.mouseX, inputManager.mouseY, 64, 64, 1); } }