Beispiel #1
0
 public void Execute(GameObject gameObject, Vector2 vector)
 {
     if (gameObject is PhysicsGameObject)
     {
         PhysicsGameObject physicsObject = (PhysicsGameObject)gameObject;
         physicsObject.body.position += move * vector;
     }
 }
Beispiel #2
0
 public void Execute(GameObject gameObject)
 {
     if(gameObject is PhysicsGameObject)
     {
         PhysicsGameObject physicsObject = (PhysicsGameObject)gameObject;
         if(physicsObject.body.OnGround())
         {
             physicsObject.body.ApplyForce(jumpingForce);
         }
     }
 }