Beispiel #1
0
    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);
    }
Beispiel #2
0
    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);
    }