예제 #1
0
 public static void Change(
     InputController input
     , ValueKeeper <bool> facingRight)
 {
     if (input.Left)
     {
         facingRight.SetValue(false);
     }
     else if (input.Right)
     {
         facingRight.SetValue(true);
     }
 }
예제 #2
0
 public static void Try(
     GameObject obj
     , ValueKeeper <int> grounded
     , ValueKeeper <int> hittingHead
     , ValueKeeper <State> state)
 {
     if (grounded == 0 && obj.Velocity.Y > 0)
     {
         state.SetValue(State.Fall);
     }
     else if (hittingHead > 0 && obj.Velocity.Y > -1000)
     {
         state.SetValue(State.Fall);
     }
 }
예제 #3
0
 private static void Bot(ValueKeeper <int> grounded, Collider target, int duration)
 {
     if (target.Parent.Identifier == Identifier.Block)
     {
         grounded.SetValue(duration);
     }
 }
예제 #4
0
 public static void Try(ValueKeeper <State> state, GameObject obj, ValueKeeper <int> hittingHead)
 {
     if (hittingHead > 0 && obj.Velocity.Y < 0)
     {
         state.SetValue(State.HeadBump);
     }
 }
예제 #5
0
 public static void Try(
     InputController input
     , ValueKeeper <int> grounded
     , ValueKeeper <State> state)
 {
     if (grounded > 0 && (input.Jump.IsPressStaring || input.Jump.Heat > 0))
     {
         state.SetValue(State.JumpStart);
     }
 }
예제 #6
0
 public static void Try(
     InputController input
     , ValueKeeper <int> grounded
     , ValueKeeper <State> state)
 {
     if (!input.Left.IsPressed && !input.Right.IsPressed && grounded == Const.Grounded_Timer)
     {
         state.SetValue(State.Idle);
     }
 }
예제 #7
0
 public static void Try(
     InputController input
     , ValueKeeper <int> grounded
     , ValueKeeper <State> state
     , GameObject obj)
 {
     if ((input.Left || input.Right) && grounded == Const.Grounded_Timer && obj.Velocity.Y >= 0)
     {
         state.SetValue(State.Walking);
     }
 }
예제 #8
0
 public static void Try(
     GameObject obj
     , InputController input
     , ValueKeeper <int> grounded
     , ValueKeeper <State> state)
 {
     if (!input.Jump.IsPressed && obj.Velocity.Y < 0 && obj.Velocity.Y < -Const.stoppingGravity)
     {
         state.SetValue(State.JumpBreak);
     }
 }
예제 #9
0
 public static void Try(ValueKeeper <State> state)
 {
     state.SetValue(State.Jump);
 }