Suppress more output

master
John 2022-06-20 19:14:34 -07:00
parent f844f0a112
commit 827afb798c
3 changed files with 11 additions and 7 deletions

View File

@ -145,7 +145,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
// load bomb sprites
bomb = new BufferedImageWrapper(("img/misc/bomb.png"));
} catch (IOException e) {
e.printStackTrace(); // TODO: remove stack trace
e.printStackTrace();
}
player = new Player(GAME_WIDTH/2, GAME_HEIGHT/2, playerSpriteArray); //create a player controlled player, set start location to middle of screenk
// add mouse and keyboard listeners
@ -187,7 +187,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
try {
player.mouseReleased(e);
} catch (IOException | SpriteException ex) {
throw new RuntimeException(ex); // TODO: remove stack trace
throw new RuntimeException(ex);
}
}
}
@ -200,7 +200,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
try {
player.mouseDragged(e);
} catch (IOException | SpriteException ex) {
throw new RuntimeException(ex); // TODO: remove stack
throw new RuntimeException(ex);
}
}
public void mouseMoved(MouseEvent e) {
@ -309,7 +309,6 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
// show particles
for(int i=0; i<particles.size(); i++){
// todo: find cause of particles being null
if(i<particles.size()&&particles.get(i)!=null) {
particles.get(i).draw(g);
particles.get(i).lifeSpan--;
@ -595,7 +594,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
try {
// pass key event to player
player.keyPressed(e);
} catch (IOException ex) { // TODO: why is IOException raised
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}

View File

@ -11,12 +11,18 @@ import java.io.PrintStream;
class Main {
public static void main(String[] args) {
// suppresses output to console
// suppresses logging to console
System.setOut(new PrintStream(new OutputStream() {
public void write(int b) {
// does nothing
}
}));
// suppresses stderr output to console
System.setErr(new PrintStream(new OutputStream() {
public void write(int b) {
// does nothing
}
}));
new GameFrame();

View File

@ -69,7 +69,6 @@ public class SettingPanel extends MenuPanel {
}
oldText = textBoxArray.get(currentBox).text;
tip.draw(g, new Color(0, 0, 0, 0), Color.lightGray);
// TODO: clean up
middlewareIndex = GameFrame.game.middlewareArray.indexOf(new Middleware(Integer.parseInt(textBoxArray.get(currentBox).id), -1));
// -2 was chosen as oldCode instead of -1 to prevent conflicts
textBoxArray.get(currentBox).text += "(" + (middlewareIndex > -1 ? (char)GameFrame.game.middlewareArray.get(middlewareIndex).newCode: