コード例 #1
0
        public void setState(CharacterState newState, MoveStats move = null)
        {
            if (newState == CharacterState.attacking || newState == CharacterState.charging || newState == CharacterState.shielding)
            {
                if (newState != CharacterState.shielding && move == null)
                {
                    throw new NotImplementedException();
                }
                attackMode = true;
            }
            else
            {
                attackMode = false;
            }

            if (newState == CharacterState.jumping || newState == CharacterState.falling)
            {
                inAir = true;
            }

            if (newState != state)
            {
                view.StateChanged(state, newState, move);
                state = newState;
            }
        }
コード例 #2
0
ファイル: MoveModel.cs プロジェクト: Grutn/TDT4240-X2
 public MoveModel(MoveStats stats, bool right, int playerIndex)
 {
     Stats          = stats;
     attackTimeLeft = stats.Duration;
     chargeTime     = 0;
     Started        = false;
     Ended          = false;
     Xdirection     = right ? new Vector2(1, 1) : new Vector2(-1, 1);
     PlayerIndexes  = new List <int>();
     PlayerIndexes.Add(playerIndex);
 }