updated enemy behavior

added more sprites, increased functionality, etc
This commit is contained in:
slevy14
2023-04-20 13:31:08 -07:00
parent cf6a69ebad
commit 775bfd76ea
58 changed files with 3068 additions and 1862 deletions

View File

@@ -34,6 +34,7 @@ public class PlayerBehavior : MonoBehaviour
_rb = GetComponent<Rigidbody2D>();
stateController = GameObject.Find("StateController").GetComponent<StateController>();
animator = GetComponent<Animator>();
GameObject.Find("Main Camera").GetComponent<CameraMovement>().player = this.gameObject;
}
void Update()
@@ -78,16 +79,16 @@ public class PlayerBehavior : MonoBehaviour
_hInput = value.Get<Vector2>().x;
if (_hInput < 0)
{
// if (forward != -1) { // if character hasnt already flipped
// FlipScale();
// }
if (forward != -1) { // if character hasnt already flipped
FlipRenderer();
}
forward = -1;
}
else if (_hInput > 0)
{
// if (forward != 1) { // if character hasnt already flipped
// FlipScale();
// }
if (forward != 1) { // if character hasnt already flipped
FlipRenderer();
}
forward = 1;
}
@@ -99,6 +100,10 @@ public class PlayerBehavior : MonoBehaviour
this.gameObject.transform.localScale = currentScale;
}
void FlipRenderer() {
GetComponent<SpriteRenderer>().flipX = !GetComponent<SpriteRenderer>().flipX;
}
void ThrowTambourine() {
if (hasTambourine && !grapplingRope.isGrappling)
{