Add Beam (Button: x)

This commit is contained in:
Sosch committed 2014-11-25 13:39:23 +01:00
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--;
}
}