|
|
|
@ -6,6 +6,10 @@ import sig.engine.Panel; |
|
|
|
|
import sig.engine.Sprite; |
|
|
|
|
|
|
|
|
|
public class Player extends Object{ |
|
|
|
|
double y_acceleration = 20; |
|
|
|
|
double x_acceleration = 0; |
|
|
|
|
double x_velocity = 0; |
|
|
|
|
double y_velocity = -4; |
|
|
|
|
|
|
|
|
|
public Player(Panel panel) { |
|
|
|
|
super(panel); |
|
|
|
@ -17,11 +21,14 @@ public class Player extends Object{ |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void update(double updateMult) { |
|
|
|
|
y_velocity += y_acceleration*updateMult; |
|
|
|
|
double displacement = y_velocity*updateMult; |
|
|
|
|
this.setY(this.getY()+displacement); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void draw(int[] p) { |
|
|
|
|
Draw_Sprite(this.getX(), this.getY(), this.getSprite()); |
|
|
|
|
Draw_Sprite(RabiClone.BASE_WIDTH/2-getSprite().getWidth()/2,RabiClone.BASE_HEIGHT*(2/3d)-getSprite().getHeight()/2, this.getSprite()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|