Commit ebeb7583 authored by nargessalehi98's avatar nargessalehi98

Add prize field for tank.

parent 4ee7bef3
...@@ -12,30 +12,37 @@ public class Tank { ...@@ -12,30 +12,37 @@ public class Tank {
BufferedImage icon; BufferedImage icon;
Bullets bullets; Bullets bullets;
GameState state; GameState state;
String prize;
int Health; int Health;
Prize prize;
public Tank(String path){ public String getPrize() {
Health=100; return prize;
}
public void setPrize(String prize) {
this.prize = prize;
}
public Tank(String path) {
Health = 100;
try { try {
icon = ImageIO.read(new File(path)); icon = ImageIO.read(new File(path));
} } catch (IOException e) {
catch (IOException e){
System.out.println("File not found "); System.out.println("File not found ");
} }
bullets=new Bullets(); bullets = new Bullets();
} }
public BufferedImage getIcon(){ public BufferedImage getIcon() {
return icon; return icon;
} }
public int getX(){ public int getX() {
return x; return x;
} }
public int getY(){ public int getY() {
return y; return y;
} }
...@@ -56,6 +63,6 @@ public class Tank { ...@@ -56,6 +63,6 @@ public class Tank {
} }
public void setHealth(int healthDamage) { public void setHealth(int healthDamage) {
Health = Health-healthDamage; Health = Health - healthDamage;
} }
} }
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