public override void Update(MooseGame game, GameTime gameTime) { if (State == Active) { StateCompleteAction = null; for (var i = 0; i < 5; i++) { FlightPath.MoveNext(); Position = FlightPath.Current; if (MageGame.Instance.BlocksPlayer(Position)) { State = Hit; StateCompleteAction = () => State = Dead; ActiveTweens.ForEach(t => t.Cancel()); break; } } } base.Update(game, gameTime); }
public override void Update(MooseGame _, GameTime gameTime) { if (State == Active) { StateCompleteAction = null; FlightPath.MoveNext(); FlightPath.MoveNext(); FlightPath.MoveNext(); FlightPath.MoveNext(); FlightPath.MoveNext(); Position = FlightPath.Current; var(x, y) = GetCell(); if (game.GetDungeonTile(x, y).IsBlocking() || game.GetMonsterTile(x, y) != MonsterTile.None) { State = Hit; StateCompleteAction = () => State = Dead; ActiveTweens.ForEach(t => t.Cancel()); } } base.Update(game, gameTime); }