Changed weapon to an upgrade

This commit is contained in:
Anuken
2018-01-05 21:04:12 -05:00
parent 5480a92cbb
commit cccf4a7e38
4 changed files with 83 additions and 83 deletions

View File

@@ -20,7 +20,7 @@ public class Player extends DestructibleEntity implements Syncable{
private static final float dashSpeed = 1.8f;
public String name = "name";
public transient Weapon weapon = Weapon.blaster;
public Weapon weapon = Weapon.blaster;
public Mech mech = Mech.standard;
public float angle;
public boolean isAndroid;
@@ -124,12 +124,11 @@ public class Player extends DestructibleEntity implements Syncable{
vector.y += ya*speed;
vector.x += xa*speed;
boolean shooting = !Inputs.keyDown("dash") && Inputs.keyDown("shootInternal") && control.getInput().recipe == null
boolean shooting = !Inputs.keyDown("dash") && Inputs.keyDown("shoot") && control.getInput().recipe == null
&& !ui.hasMouse() && !control.getInput().onConfigurable();
if(shooting && Timers.get(this, "reload", weapon.reload)){
weapon.shoot(this, x, y, Angles.mouseAngle(x, y));
Sounds.play(weapon.shootsound);
if(shooting){
weapon.update(player);
}
if(Inputs.keyDown("dash") && Timers.get(this, "dashfx", 3) && vector.len() > 0){