|
|
@ -6,6 +6,10 @@ import sig.engine.Panel; |
|
|
|
import sig.engine.Sprite; |
|
|
|
import sig.engine.Sprite; |
|
|
|
|
|
|
|
|
|
|
|
public class Player extends Object{ |
|
|
|
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) { |
|
|
|
public Player(Panel panel) { |
|
|
|
super(panel); |
|
|
|
super(panel); |
|
|
@ -17,11 +21,14 @@ public class Player extends Object{ |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void update(double updateMult) { |
|
|
|
public void update(double updateMult) { |
|
|
|
|
|
|
|
y_velocity += y_acceleration*updateMult; |
|
|
|
|
|
|
|
double displacement = y_velocity*updateMult; |
|
|
|
|
|
|
|
this.setY(this.getY()+displacement); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void draw(int[] p) { |
|
|
|
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()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|