diff --git a/src/de/teamteamteam/spacescooter/entity/Entity.java b/src/de/teamteamteam/spacescooter/entity/Entity.java index dfa188f..8e067ee 100644 --- a/src/de/teamteamteam/spacescooter/entity/Entity.java +++ b/src/de/teamteamteam/spacescooter/entity/Entity.java @@ -4,6 +4,8 @@ import java.awt.Color; import java.awt.Graphics; import java.awt.image.BufferedImage; +import de.teamteamteam.spacescooter.utility.GameConfig; + public abstract class Entity implements Updateable, Paintable { /** @@ -53,8 +55,10 @@ public abstract class Entity implements Updateable, Paintable { public void paint(Graphics g) { //DEBUG ONLY - g.setColor(new Color(255,0,0)); - g.drawRect(this.x, this.y, this.getWidth(), this.getHeight()); + if(GameConfig.DEBUG) { + g.setColor(new Color(255,0,0)); + g.drawRect(this.x, this.y, this.getWidth(), this.getHeight()); + } g.drawImage(this.img, this.x, this.y, null); } diff --git a/src/de/teamteamteam/spacescooter/entity/LivingEntity.java b/src/de/teamteamteam/spacescooter/entity/LivingEntity.java index dd4b1c2..6df937d 100644 --- a/src/de/teamteamteam/spacescooter/entity/LivingEntity.java +++ b/src/de/teamteamteam/spacescooter/entity/LivingEntity.java @@ -4,6 +4,7 @@ import java.awt.Rectangle; import java.util.LinkedList; import de.teamteamteam.spacescooter.screen.Screen; +import de.teamteamteam.spacescooter.utility.GameConfig; public abstract class LivingEntity extends Entity implements Collidable { @@ -72,12 +73,12 @@ public abstract class LivingEntity extends Entity implements Collidable { public void takeDamage(int damage) { if(this instanceof Shot) { - System.out.println("Shot took damage: " + damage + "left: "+this.getHealthPoints()+" (" + this + ")"); + if(GameConfig.DEBUG) System.out.println("Shot took damage: " + damage + "left: "+this.getHealthPoints()+" (" + this + ")"); } // TODO: shield and health logic this.healthPoints -= damage; if (this.isAlive() == false) { - System.out.println(this + " ist gestorben. RIP"); + if(GameConfig.DEBUG) System.out.println(this + " ist gestorben. RIP"); Screen.currentScreen.removeEntity(this); } } diff --git a/src/de/teamteamteam/spacescooter/gui/GameFrame.java b/src/de/teamteamteam/spacescooter/gui/GameFrame.java index c565069..e21da76 100644 --- a/src/de/teamteamteam/spacescooter/gui/GameFrame.java +++ b/src/de/teamteamteam/spacescooter/gui/GameFrame.java @@ -33,6 +33,7 @@ public class GameFrame extends JFrame { public void init() { this.setTitle("Unser schöner Titel"); this.setSize(GameConfig.windowWidth, GameConfig.windowHeight); + this.setResizable(false); this.setUndecorated(false); this.setDefaultCloseOperation(EXIT_ON_CLOSE); diff --git a/src/de/teamteamteam/spacescooter/utility/GameConfig.java b/src/de/teamteamteam/spacescooter/utility/GameConfig.java index 8f3a510..f2a1cbc 100644 --- a/src/de/teamteamteam/spacescooter/utility/GameConfig.java +++ b/src/de/teamteamteam/spacescooter/utility/GameConfig.java @@ -2,7 +2,9 @@ package de.teamteamteam.spacescooter.utility; public class GameConfig { - public static int windowHeight; + public static boolean DEBUG = false; + public static int windowWidth; + public static int windowHeight; } diff --git a/src/de/teamteamteam/spacescooter/utility/GraphicsSettings.java b/src/de/teamteamteam/spacescooter/utility/GraphicsSettings.java index a84e227..40a4862 100644 --- a/src/de/teamteamteam/spacescooter/utility/GraphicsSettings.java +++ b/src/de/teamteamteam/spacescooter/utility/GraphicsSettings.java @@ -34,7 +34,7 @@ public class GraphicsSettings { this.height = dm.getHeight(); this.width = dm.getWidth(); - System.out.println("Display Mode " + i + ": " + this.width + "x" + this.height+ "@" + this.refreshRate + "Hz, " + this.bitDepth + " bit"); + if(GameConfig.DEBUG) System.out.println("Display Mode " + i + ": " + this.width + "x" + this.height+ "@" + this.refreshRate + "Hz, " + this.bitDepth + " bit"); } }