aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-06-13 00:51:49 -0400
committerCameron Katri <me@cameronkatri.com>2021-06-13 00:51:49 -0400
commit853b013d3c0127fb2c04a7cfeab23c77d52fc51f (patch)
tree76848d5ea30ff10c37161eceff90fc1954689ec7
parent13b102b0055d1780255d083f01ae5672ccc7ade7 (diff)
downloadgmtk-gamejam-853b013d3c0127fb2c04a7cfeab23c77d52fc51f.tar.gz
gmtk-gamejam-853b013d3c0127fb2c04a7cfeab23c77d52fc51f.tar.zst
gmtk-gamejam-853b013d3c0127fb2c04a7cfeab23c77d52fc51f.zip
Hold ball away from face
-rw-r--r--Assets/Scripts/Controllers/AIController.cs4
-rw-r--r--Assets/Scripts/Controllers/Player/PlayerController.cs2
2 files changed, 3 insertions, 3 deletions
diff --git a/Assets/Scripts/Controllers/AIController.cs b/Assets/Scripts/Controllers/AIController.cs
index cdfc9a8..a7de4fb 100644
--- a/Assets/Scripts/Controllers/AIController.cs
+++ b/Assets/Scripts/Controllers/AIController.cs
@@ -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));
diff --git a/Assets/Scripts/Controllers/Player/PlayerController.cs b/Assets/Scripts/Controllers/Player/PlayerController.cs
index 9df8c0a..134abdc 100644
--- a/Assets/Scripts/Controllers/Player/PlayerController.cs
+++ b/Assets/Scripts/Controllers/Player/PlayerController.cs
@@ -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);