Add Beam (Button: x)
This commit is contained in:
1 parent
df8077874c
commit
e4ebc31a1b
7 files changed
+70
-10
No files matched your search
@@ -33,7 +33,12 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
||||
/**
|
||||
* the Players Rocket Ammunition
|
||||
*/
|
||||
private int rocketAmount = 1;
|
||||
private int rocketAmount = 10;
|
||||
|
||||
/**
|
||||
* the Players Beam Ammunition
|
||||
*/
|
||||
private int beamAmount = 10;
|
||||
|
||||
|
||||
/**
|
||||
@@ -96,6 +101,11 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
||||
this.shootRocket();
|
||||
}
|
||||
}
|
||||
if(Keyboard.isKeyDown(KeyEvent.VK_X)) {
|
||||
if(this.beamAmount > 0){
|
||||
this.shootBeam();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,6 +219,10 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
||||
return rocketAmount;
|
||||
}
|
||||
|
||||
public int getBeamAmount(){
|
||||
return beamAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add one rocket.
|
||||
*/
|
||||
@@ -216,6 +230,10 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
||||
rocketAmount++;
|
||||
}
|
||||
|
||||
public void addBeamAmount(){
|
||||
beamAmount++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove one rocket.
|
||||
*/
|
||||
@@ -223,4 +241,8 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
||||
rocketAmount--;
|
||||
}
|
||||
|
||||
public void removeBeamAmount(){
|
||||
beamAmount--;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user