Commit 24c4d441 authored by nargessalehi98's avatar nargessalehi98

Add prize boolean .

parent 0ea412a7
......@@ -14,8 +14,13 @@ public class Tank {
boolean alive;
String prize;
int Health;
boolean bulletEffect;
boolean laser;
boolean bullet2;
boolean bullet3;
public Tank(String path, int x, int y, double rotateAmount) {
prize="empty";
Health = 100;
try {
icon = ImageIO.read(new File(path));
......@@ -60,4 +65,33 @@ public class Tank {
public void setPrize(String prize) {
this.prize = prize;
}
public void applyPrize() {
if(!prize.equals("empty")) {
if (prize.equals("life"))
Health += 10;
// if (Health > 100)
// Health = 100;
if (prize.equals("shield")) {
if (Controller.renderCountLimit - 50 == Controller.renderCount)
bulletEffect = true;
else
bulletEffect = false;
}
if (prize.equals("bullet2")) {
if (!bullet2)
bullet2 = true;
}
if (prize.equals("bullet3")) {
if (!bullet3)
bullet3 = true;
}
if (prize.equals("laser")) {
if (Controller.renderCountLimit - 410 == Controller.renderCount)
laser = false;
else
laser = true;
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment