コード例 #1
0
ファイル: Pivot.cs プロジェクト: mwaitzman/TussleOverdrive
    public override void stateTransitions()
    {
        base.stateTransitions();
        //These classes will be phased out as time goes on. Until then, we need to just exit early if we're in the builder since these don't actually use Subactions
        if (isInBuilder)
        {
            return;
        }
        StateTransitions.StopState(actor.GetAbstractFighter());
        StateTransitions.CheckGround(actor.GetAbstractFighter());

        //(key, invkey) = _actor.getForwardBackwardKeys()
        //if (self.direction == 1 and _actor.sprite.flip == "left") or(self.direction == -1 and _actor.sprite.flip == "right"):
        //    _actor.sprite.flipX()

        AbstractFighter fighter = actor.GetAbstractFighter();

        if (current_frame == last_frame)
        {
            if (fighter.KeyHeld("Forward"))
            {
                if (fighter.CheckSmash("ForwardSmash"))
                {
                    actor.SendMessage("doAction", "Dash");
                }
                else
                {
                    actor.SendMessage("doAction", "Move");
                }
            }
            else if (fighter.KeyHeld("Backward"))
            {
                actor.SendMessage("flip");
                if (fighter.CheckSmash("BackwardSmash"))
                {
                    actor.SendMessage("doAction", "Dash");
                }
                else
                {
                    actor.SendMessage("doAction", "Move");
                }
            }
            else
            {
                actor.SendMessage("doAction", "NeutralAction");
            }
        }
    }