public PlayerController(Entity player) { this.player = player; engine = Engine.instance; camera = engine.mainCamera; inputState = EPlayerInputState.Normal; cursor = new TileCursor(this); hud = new HUD(this); }
public void ReInitController(Entity newPlayer) { player = newPlayer; foreach (var window in hud.windows) { window.CleanupWindow(); } hud = new HUD(this); inputState = EPlayerInputState.Normal; }
/// <summary> /// Sends the player controller into the new input state, changing the behaviour of the controller /// </summary> public void GotoInputState(EPlayerInputState newState) { if (newState == inputState) { return; } inputState = newState; // Update the cursor location to be the players location if (newState == EPlayerInputState.TileSelect) { cursor.position = player.position; } }