Exemplo n.º 1
0
 public States Main_Right(States currentState, GroundType groundType)
 {
     mechanics.MoveRight();
     if (!command.MoveRight()) //move key
     {
         return(States.IDLE);
     }
     else if (command.MoveLeft()) //move key
     {
         return(States.IDLE);
     }
     else if (groundType == GroundType.AIR)
     {
         return(States.IN_FALL);
     }
     return(currentState);
 }
Exemplo n.º 2
0
 public States Main_Grab(States currentState)
 {
     otherState.currentState = States.IN_GRAB;
     mechanics.GrabAttach(gameObject, otherPlayer);
     if (!command.Grab()) //grab key
     {
         mechanics.GrabDeattach(otherPlayer);
         return(States.IDLE);
     }
     else if (command.MoveLeft()) //move key
     {
         mechanics.MoveLeft();
     }
     else if (command.MoveRight()) //move key
     {
         mechanics.MoveRight();
     }
     return(currentState);
 }