public override void Exit(object owner) { PlayerGameObject player = owner as PlayerGameObject; if (player != null) { } }
public MousePointer(CommandManager commandManager, PlayerGameObject player) { this.commandManager = commandManager; this.player = player; //commandManager.m_Input.OnKeyPressed += MousePressed; }
public override void Exit(object owner) { PlayerGameObject player = owner as PlayerGameObject; if (player != null) { currentTime = 0.0; } }
public override void Execute(object owner, GameTime gameTime) { PlayerGameObject player = owner as PlayerGameObject; if (player != null) { player.MoveTowardEntity(player.target, gameTime); } }
public override void Enter(object owner) { PlayerGameObject player = owner as PlayerGameObject; if (player != null) { player.state = PlayerGameObject.PlayerState.Chase; } }
public override void Exit(object owner) { PlayerGameObject player = owner as PlayerGameObject; if (player != null) { player.Speed = player.MaxSpeed; } }
public override void Enter(object owner) { PlayerGameObject player = owner as PlayerGameObject; if (player != null) { player.state = PlayerGameObject.PlayerState.Walk; player.Speed = player.MaxSpeed; } }
public override void Enter(object owner) { PlayerGameObject player = owner as PlayerGameObject; if (player != null) { //player.Speed = 0; player.state = PlayerGameObject.PlayerState.Attack; currentTime = 0.0; } }
public void InitialiseMainGameState() { entities = new List <GameObjectBase>(); mapManager = new MapManager(); collisionManager = new CollisionManager(); player = new PlayerGameObject(); player.Initialise(); Commands = new CommandManager(); mousePointer = new MousePointer(Commands, player); InitialiseBindings(); }
public void UnloadMainGameContent() { //clear registered events player.CollideWithEnemy -= CollideWithEnemyTest; player.DamageEnemy -= player.Damage; //mousePointer.SelectEnemy -= mousePointer.MouseSelectEntity; foreach (EnemyGameObject enemy in enemies) { enemy.DamagePlayer -= HurtPlayerTest; enemy.EnemyDies -= SpawnPotion; } potions.Clear(); enemies.Clear(); player = null; entities.Clear(); collisionManager = null; Commands = null; ClearMapTypes(); Resources.UnloadContent(Content); MediaPlayer.Stop(); #region Constrain mouse to window - not implemented //if (Mouse.GetState().X < 0) // Mouse.SetPosition(0, Mouse.GetState().Y); //if (Mouse.GetState().X > ScreenWidth) // Mouse.SetPosition(ScreenHeight, Mouse.GetState().Y); //if (Mouse.GetState().Y < 0) // Mouse.SetPosition(Mouse.GetState().X, 0); //if (Mouse.GetState().Y > ScreenWidth) // Mouse.SetPosition(Mouse.GetState().X, ScreenHeight); #endregion base.UnloadContent(); }
public override void Execute(object owner, GameTime gameTime) { PlayerGameObject player = owner as PlayerGameObject; if (player == null) { return; } if (currentTime >= dyingTime) { player.Die(); currentTime = 0.0; } else { currentTime += gameTime.ElapsedGameTime.TotalSeconds; } }
public override void Execute(object owner, GameTime gameTime) { PlayerGameObject player = owner as PlayerGameObject; if (player == null) { return; } if (currentTime >= attackCooldownTime) { //player.MoveTowardEntity(player.target, gameTime); player.Attack(); currentTime = 0.0f; } else { currentTime += gameTime.ElapsedGameTime.TotalSeconds; } }
//TODO: put these methods into appropriate managing class private void HurtEnemyTest(object attacker, object receiver, EventArgs e) { PlayerGameObject player = attacker as PlayerGameObject; }
public override void Execute(object owner, GameTime gameTime) { PlayerGameObject player = owner as PlayerGameObject; }