From 2c5c2d3ba46fc1f396be710c50c2f6aeb9b2f697 Mon Sep 17 00:00:00 2001 From: 17bthompson Date: Tue, 31 May 2016 10:29:31 -0400 Subject: [PATCH] Added a black box to the bottom of the game, and added gamemode changing. --- src/tanks/Tanks.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/tanks/Tanks.java b/src/tanks/Tanks.java index 9801809..79e52ca 100644 --- a/src/tanks/Tanks.java +++ b/src/tanks/Tanks.java @@ -24,7 +24,7 @@ public class Tanks private JFrame frame; private JPanel panel; private int fheight=500; - private int fwidth=500; + private int fwidth=800; private Timer move; private KeyListener key; @@ -41,7 +41,7 @@ public class Tanks frame=new JFrame("Tanks project"); - frame.setSize(500,500); + frame.setSize(fwidth,fheight + 150); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); newGame(); @@ -80,7 +80,8 @@ public class Tanks { en.draw(g); } - + g.setColor(Color.BLACK); + g.fillRect(0, fheight, fwidth, 150); p.draw(g); } }; @@ -273,6 +274,10 @@ public class Tanks { enemy.remove(this); p.takeDamage(); + if(!p.isAlive) + { + wave.setGameMode(2); + } } } } @@ -343,6 +348,10 @@ public class Tanks { p.takeDamage(); bullets.remove(this); + if(!p.isAlive) + { + wave.setGameMode(2); + } } } }