]> git.cameronkatri.com Git - gmtk-gamejam.git/commitdiff
Hold ball away from face
authorCameron Katri <me@cameronkatri.com>
Sun, 13 Jun 2021 04:51:49 +0000 (00:51 -0400)
committerCameron Katri <me@cameronkatri.com>
Sun, 13 Jun 2021 04:51:49 +0000 (00:51 -0400)
Assets/Scripts/Controllers/AIController.cs
Assets/Scripts/Controllers/Player/PlayerController.cs

index cdfc9a8220e514686f28af98f4e05ca26d6bf482..a7de4fb71b80463fad0b86cc61ee79c42d641677 100644 (file)
@@ -95,10 +95,10 @@ namespace Controllers
         flipper.transform.localScale = new Vector3(1f, 1f, 1f);
       else
         flipper.transform.localScale = new Vector3(-1f, 1f, 1f);
+
+      game.enemy.Move(transform.position + new Vector3(0f, BoxCollider.size.y * 3/4, 0f) + (transform.right * (0.5f * (turn && currentTurn ? -1 : 1))));
       turn = currentTurn;
 
-      game.enemy.Move(transform.position + new Vector3(0f, BoxCollider.size.y * 3/4, 0f));
-      
       leftLeg.top.transform.localRotation = Quaternion.Euler(0, 0, maxLegAngle * Mathf.Sin(animationStep * legSpeed));
       leftLeg.bottom.transform.localRotation = Quaternion.Euler(0, 0, maxLegAngle + maxLegAngle * Mathf.Sin(animationStep * legSpeed));
       rightLeg.top.transform.localRotation = Quaternion.Euler(0, 0, maxLegAngle * Mathf.Sin(animationStep * -legSpeed));
index 9df8c0a93957c9c4ad5f6541cedd923dd85c4f7b..134abdc06a68d5d77c4ce8d3c8bd5402837143db 100644 (file)
@@ -81,7 +81,7 @@ namespace Controllers.Player
 
         if (segment.isTop)
         {
-          game.player.Move(segment.transform.position);
+          game.player.Move(segment.transform.position + segment.transform.right * (0.5f * (root.Rigidbody.velocity.x > 0.01f ? 1 : -1)));
           
           // Point the arms at the ball.
           segment.left.arm.transform.up = -(game.ball.transform.position - segment.left.arm.transform.position);