Commit a737b010 authored by nargessalehi98's avatar nargessalehi98

Add alive field.

parent 3c1f24f1
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
......@@ -10,28 +9,24 @@ public class Tank {
int y;
double rotateAmount;
BufferedImage icon;
Bullets bullets;
Bullet bullet;
GameState state;
boolean alive;
String prize;
int Health;
public String getPrize() {
return prize;
}
public void setPrize(String prize) {
this.prize = prize;
}
public Tank(String path) {
public Tank(String path, int x, int y, double rotateAmount) {
Health = 100;
try {
icon = ImageIO.read(new File(path));
} catch (IOException e) {
System.out.println("File not found ");
}
alive = true;
this.x = x;
this.y = y;
this.rotateAmount = rotateAmount;
bullets = new Bullets();
}
public BufferedImage getIcon() {
......@@ -50,14 +45,6 @@ public class Tank {
return state;
}
public double getRotateAmount() {
return rotateAmount;
}
public Bullets getBullets() {
return bullets;
}
public int getHealth() {
return Health;
}
......@@ -65,4 +52,12 @@ public class Tank {
public void setHealth(int healthDamage) {
Health = Health - healthDamage;
}
}
public String getPrize() {
return prize;
}
public void setPrize(String prize) {
this.prize = prize;
}
}
\ 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