Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>main
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1021 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1004 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 988 B |
@ -0,0 +1,80 @@ |
||||
package sig.objects; |
||||
|
||||
import sig.engine.AnimatedSprite; |
||||
import sig.engine.Panel; |
||||
import sig.engine.Rectangle; |
||||
import sig.engine.Transform; |
||||
import sig.objects.actor.PhysicsObject; |
||||
|
||||
public class BunnyGirls extends PhysicsObject{ |
||||
|
||||
double lastMoved = 0; |
||||
double lastJumped = 0; |
||||
boolean moveDir = false; |
||||
double moveTimer = 0; |
||||
|
||||
protected BunnyGirls(AnimatedSprite spr, double animationSpd, Panel panel) { |
||||
super(spr, animationSpd, panel); |
||||
} |
||||
|
||||
@Override |
||||
public void update(double updateMult) { |
||||
super.update(updateMult); |
||||
lastMoved+=updateMult; |
||||
lastJumped+=updateMult; |
||||
if (lastMoved>5) { |
||||
switch ((int)(Math.random()*3)) { |
||||
case 0:{ |
||||
moveDir=true; |
||||
moveTimer=Math.random()*3; |
||||
}break; |
||||
case 1:{ |
||||
moveDir=false; |
||||
moveTimer=Math.random()*3; |
||||
}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; |
||||
} |
||||
|
||||
@Override |
||||
public boolean rightKeyHeld() { |
||||
return moveTimer>0&&moveDir; |
||||
} |
||||
|
||||
@Override |
||||
public boolean leftKeyHeld() { |
||||
return moveTimer>0&&!moveDir; |
||||
} |
||||
|
||||
@Override |
||||
public Rectangle setCollisionBounds() { |
||||
return new Rectangle(10,6,12,25); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isFriendlyObject() { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public void draw(byte[] p) { |
||||
} |
||||
|
||||
@Override |
||||
public Transform getSpriteTransform() { |
||||
return moveDir?Transform.HORIZONTAL:Transform.NONE; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,27 @@ |
||||
package sig.objects.enemies; |
||||
|
||||
import sig.RabiClone; |
||||
import sig.engine.Sprite; |
||||
import sig.objects.BunnyGirls; |
||||
import sig.objects.actor.PhysicsObject; |
||||
|
||||
public class BlueBun extends BunnyGirls{ |
||||
|
||||
public BlueBun(double x, double y) { |
||||
super(Sprite.BLUE_STAND, 6.5, RabiClone.p); |
||||
setX(x); |
||||
setY(y); |
||||
setAccelerationLimits(100, 100); |
||||
setVelocityLimits(500, 500); |
||||
setGroundDrag(2000); |
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION); |
||||
setAirDrag(800); |
||||
setAirFriction(180); |
||||
setSlidingVelocity(164); |
||||
setSlidingAcceleration(120); |
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY); |
||||
setGravity(950); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,29 @@ |
||||
package sig.objects.enemies; |
||||
|
||||
import sig.RabiClone; |
||||
import sig.engine.AnimatedSprite; |
||||
import sig.engine.Panel; |
||||
import sig.engine.Sprite; |
||||
import sig.objects.BunnyGirls; |
||||
import sig.objects.actor.PhysicsObject; |
||||
|
||||
public class GreenBun extends BunnyGirls{ |
||||
|
||||
public GreenBun(double x, double y) { |
||||
super(Sprite.GREEN_STAND, 6.5, RabiClone.p); |
||||
setX(x); |
||||
setY(y); |
||||
setAccelerationLimits(100, 100); |
||||
setVelocityLimits(500, 500); |
||||
setGroundDrag(2000); |
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION); |
||||
setAirDrag(800); |
||||
setAirFriction(180); |
||||
setSlidingVelocity(164); |
||||
setSlidingAcceleration(120); |
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY); |
||||
setGravity(1550); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,26 @@ |
||||
package sig.objects.enemies; |
||||
|
||||
import sig.RabiClone; |
||||
import sig.engine.Sprite; |
||||
import sig.objects.BunnyGirls; |
||||
import sig.objects.actor.PhysicsObject; |
||||
|
||||
public class RedBun extends BunnyGirls{ |
||||
|
||||
public RedBun(double x, double y) { |
||||
super(Sprite.RED_STAND, 6.5, RabiClone.p); |
||||
setX(x); |
||||
setY(y); |
||||
setAccelerationLimits(100, 100); |
||||
setVelocityLimits(500, 500); |
||||
setGroundDrag(2000); |
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION); |
||||
setAirDrag(800); |
||||
setAirFriction(180); |
||||
setSlidingVelocity(164); |
||||
setSlidingAcceleration(120); |
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY); |
||||
setGravity(750); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,29 @@ |
||||
package sig.objects.enemies; |
||||
|
||||
import sig.RabiClone; |
||||
import sig.engine.AnimatedSprite; |
||||
import sig.engine.Panel; |
||||
import sig.engine.Sprite; |
||||
import sig.objects.BunnyGirls; |
||||
import sig.objects.actor.PhysicsObject; |
||||
|
||||
public class YellowBun extends BunnyGirls{ |
||||
|
||||
public YellowBun(double x, double y) { |
||||
super(Sprite.YELLOW_STAND, 6.5, RabiClone.p); |
||||
setX(x); |
||||
setY(y); |
||||
setAccelerationLimits(100, 100); |
||||
setVelocityLimits(500, 500); |
||||
setGroundDrag(2000); |
||||
setGroundFriction(PhysicsObject.NORMAL_FRICTION); |
||||
setAirDrag(800); |
||||
setAirFriction(180); |
||||
setSlidingVelocity(164); |
||||
setSlidingAcceleration(120); |
||||
setJumpVelocity(PhysicsObject.NORMAL_JUMP_VELOCITY); |
||||
setGravity(150); |
||||
} |
||||
|
||||
|
||||
} |