Commit 4d24925c authored by nargessalehi98's avatar nargessalehi98

Add setEnemy method.

parent ebeb7583
...@@ -193,6 +193,7 @@ public class GameFrame extends JFrame { ...@@ -193,6 +193,7 @@ public class GameFrame extends JFrame {
g2d.setColor(Color.black); g2d.setColor(Color.black);
//g2d.drawImage(rotate(image1, state1.rotateAmount), state1.locX, state1.locY, null); //g2d.drawImage(rotate(image1, state1.rotateAmount), state1.locX, state1.locY, null);
setTanks(3, g2d, state, state1, state2); setTanks(3, g2d, state, state1, state2);
setEnemy(g2d);
setName(g2d, "narges", "sara", "bardia"); setName(g2d, "narges", "sara", "bardia");
setMap(g2d, new File("map3.txt")); setMap(g2d, new File("map3.txt"));
drawMap(g2d); drawMap(g2d);
...@@ -239,6 +240,12 @@ public class GameFrame extends JFrame { ...@@ -239,6 +240,12 @@ public class GameFrame extends JFrame {
// g2d.drawImage(image5, 1050, 750, null); // g2d.drawImage(image5, 1050, 750, null);
} }
public void setEnemy(Graphics2D g2d){
Tank tank = new Tank("enemy.png");
taken = tank.getIcon();
tanks.add(tank);
g2d.drawImage(tank.getIcon(), 200, 200, null);
}
public void setTanks(int numOfPlayer, Graphics2D g2d, GameState state, GameState state1, GameState state2) { public void setTanks(int numOfPlayer, Graphics2D g2d, GameState state, GameState state1, GameState state2) {
//g2d.drawImage(background, 0, 0, null); //g2d.drawImage(background, 0, 0, null);
if (numOfPlayer > 0) { if (numOfPlayer > 0) {
......
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