mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-10-11 18:19:11 +00:00
I'm tired, I'm sleeping
Hey if someone could expand on this that'd be great I think
This commit is contained in:
1 parent
8539237c26
commit
efd8a2bc3f
5 files changed
+4192
-26
No files matched your search
@@ -24,6 +24,8 @@ public class NPC : MonoBehaviour
|
||||
{
|
||||
delay = Random.Range(minDelay, maxDelay);
|
||||
horizontalMove = horizontalMove * runSpeed;
|
||||
leftBound += controller.transform.localPosition.x;
|
||||
rightBound -= controller.transform.localPosition.x;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -42,10 +44,10 @@ public class NPC : MonoBehaviour
|
||||
animator.SetBool("Airborne", !controller.m_Grounded);
|
||||
}
|
||||
elapsed += Time.deltaTime;
|
||||
if(transform.position.x > rightBound) {
|
||||
if(transform.localPosition.x > rightBound) {
|
||||
horizontalMove = -1 * runSpeed;
|
||||
}
|
||||
if(transform.position.x < leftBound) {
|
||||
} else
|
||||
if(transform.localPosition.x < leftBound) {
|
||||
horizontalMove = runSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user