Ejemplo n.º 1
0
 /*
  * ▒███████▒████████▒▒████████
  * ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒
  * ██▒▒▒██▒▒████████▒▒▒▒▒██▒▒▒
  * ▒██▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒
  * ▒▒█████▒▒████████▒▒▒▒▒██▒▒▒
  */
 private int GetDirection(CharaInputManager input)
 {
     u = input.GetKey("up0");
     l = input.GetKey("left0");
     d = input.GetKey("down0");
     r = input.GetKey("right0");
     return(u ?
            (d ? (l ? (r ? 0 : 4) : (r ? 6 : 0)) : (l ? (r ? 8 : 7) : (r ? (l ? 8 : 9) : 8))) :
            (l ? (r ? (d ? 2 : 0) : (d ? 1 : 4)) : (r ? (d ? 3 : 6) : (d ? 2 : 0))));
 }
Ejemplo n.º 2
0
    private void SetMovementState(CharaInputManager input)
    {
        Direction = GetDirection(input);
        switch (Direction)
        {
        case 0:
        default:
            MovementState = "Idle";
            break;

        case 1:
        case 2:
        case 3:
        case 4:
        case 6:
        case 7:
        case 8:
        case 9:
            if (Input.GetKey("dash"))
            {
                ExecuteDash();
                MovementState = "Dash";
            }
            else
            {
                ExecuteWalk();
                MovementState = "Walk";
            }
            break;
        }
    }
Ejemplo n.º 3
0
    /*
     * ▒██████▒▒████████▒████████
     * ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
     * ▒██████▒▒████████▒▒▒▒██▒▒▒
     * ▒▒▒▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
     * ▒██████▒▒████████▒▒▒▒██▒▒▒
     */

    private void SetActionState(CharaInputManager input)
    {
        if (input.GetKey("fire"))
        {
            ExecuteFire();
            ActionState = "Fire";
        }
        else
        {
            ActionState = "";
        }
    }
Ejemplo n.º 4
0
 /*
   ▒██████▒▒████████▒████████
   ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ▒██████▒▒████████▒▒▒▒██▒▒▒
   ▒▒▒▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ▒██████▒▒████████▒▒▒▒██▒▒▒
  */
 private void SetActionState(CharaInputManager input)
 {
     if (input.GetKey("fire")) {
         ExecuteFire();
         ActionState = "Fire";
     } else {
         ActionState = "";
     }
 }
Ejemplo n.º 5
0
 /*
   ▒███████▒████████▒▒████████
   ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ██▒▒▒██▒▒████████▒▒▒▒▒██▒▒▒
   ▒██▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ▒▒█████▒▒████████▒▒▒▒▒██▒▒▒
  */
 private int GetDirection(CharaInputManager input)
 {
     u = input.GetKey("up0");
     l = input.GetKey("left0");
     d = input.GetKey("down0");
     r = input.GetKey("right0");
     return u ?
         (d ? (l ? (r ? 0 : 4) : (r ? 6 : 0)) : (l ? (r ? 8 : 7) : (r ? (l ? 8 : 9) : 8))) :
         (l ? (r ? (d ? 2 : 0) : (d ? 1 : 4)) : (r ? (d ? 3 : 6) : (d ? 2 : 0)));
 }