updated enemy behavior
added more sprites, increased functionality, etc
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user