diff --git a/src/sig/objects/Erinoah.java b/src/sig/objects/Erinoah.java index 3c4601b..af8f039 100644 --- a/src/sig/objects/Erinoah.java +++ b/src/sig/objects/Erinoah.java @@ -10,6 +10,7 @@ import sig.objects.actor.RenderedObject; public class Erinoah extends PhysicsObject implements RenderedObject{ double lastMoved = 0; + double lastJumped = 0; boolean moveDir = false; double moveTimer = 0; @@ -37,6 +38,7 @@ public class Erinoah extends PhysicsObject implements RenderedObject{ public void update(double updateMult) { super.update(updateMult); lastMoved+=updateMult; + lastJumped+=updateMult; if (lastMoved>5) { switch ((int)(Math.random()*3)) { case 0:{ @@ -47,9 +49,17 @@ public class Erinoah extends PhysicsObject implements RenderedObject{ moveDir=false; moveTimer=Math.random()*3; }break; - case 2:{ - lastMoved=0; - }break; + } + lastMoved=0; + } + if (lastJumped>3) { + if (Math.random()<=0.4&&jumpCount>0) { + y_velocity = jump_velocity; + jumpCount--; + lastJumped=2.5+Math.random()*0.5; + lastMoved=4.5+Math.random()*0.5; + } else { + lastJumped=0; } } moveTimer-=updateMult; diff --git a/src/sig/objects/actor/State.java b/src/sig/objects/actor/State.java index e505dbc..6b9d92d 100644 --- a/src/sig/objects/actor/State.java +++ b/src/sig/objects/actor/State.java @@ -1,11 +1,11 @@ package sig.objects.actor; public enum State{ -IDLE, -SLIDE, -JUMP, -FALLING, -ATTACK, -STAGGER, -UNCONTROLLABLE + IDLE, + SLIDE, + JUMP, + FALLING, + ATTACK, + STAGGER, + UNCONTROLLABLE } \ No newline at end of file