Buns walkin

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
unknown 2022-06-18 12:26:22 +03:00
parent 8d30600d78
commit 2ee64f8007

View File

@ -9,6 +9,7 @@ import sig.objects.actor.PhysicsObject;
public class BunnyGirls extends PhysicsObject{ public class BunnyGirls extends PhysicsObject{
AnimatedSprite walkingSprite; AnimatedSprite walkingSprite;
AnimatedSprite standingSprite;
double lastMoved = 0; double lastMoved = 0;
double lastJumped = 0; double lastJumped = 0;
boolean moveDir = false; boolean moveDir = false;
@ -17,6 +18,7 @@ public class BunnyGirls extends PhysicsObject{
protected BunnyGirls(AnimatedSprite spr,AnimatedSprite walkingSpr, double animationSpd, Panel panel) { protected BunnyGirls(AnimatedSprite spr,AnimatedSprite walkingSpr, double animationSpd, Panel panel) {
super(spr, animationSpd, panel); super(spr, animationSpd, panel);
this.walkingSprite=walkingSpr; this.walkingSprite=walkingSpr;
this.standingSprite=spr;
} }
@Override @Override
@ -28,10 +30,12 @@ public class BunnyGirls extends PhysicsObject{
switch ((int)(Math.random()*3)) { switch ((int)(Math.random()*3)) {
case 0:{ case 0:{
moveDir=true; moveDir=true;
setAnimatedSpr(walkingSprite);
moveTimer=Math.random()*3; moveTimer=Math.random()*3;
}break; }break;
case 1:{ case 1:{
moveDir=false; moveDir=false;
setAnimatedSpr(walkingSprite);
moveTimer=Math.random()*3; moveTimer=Math.random()*3;
}break; }break;
} }
@ -48,6 +52,9 @@ public class BunnyGirls extends PhysicsObject{
} }
} }
moveTimer-=updateMult; moveTimer-=updateMult;
if(moveTimer<=0){
setAnimatedSpr(standingSprite);
}
} }
@Override @Override