diff options
Diffstat (limited to 'src/main/java/Subconscious.java')
-rw-r--r-- | src/main/java/Subconscious.java | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/main/java/Subconscious.java b/src/main/java/Subconscious.java index 8fed909..3e66800 100644 --- a/src/main/java/Subconscious.java +++ b/src/main/java/Subconscious.java @@ -52,7 +52,7 @@ public class Subconscious addComponentListener(this); } - public void createWindow() { + private void createWindow() { window = new JFrame(TITLE); window.setSize(new Dimension(800, 600)); window.setMinimumSize(getSize()); @@ -60,11 +60,11 @@ public class Subconscious } /* game logic */ - public void gameLoop() { + private void gameLoop() { } - public void gameRender() { + private void gameRender() { if (dbImage == null) { dbImage = createImage(getWidth(), getHeight()); if (dbImage == null) { @@ -87,6 +87,7 @@ public class Subconscious } /* animator and game thread */ + @Override public void run() { long beforeTime, afterTime, sleepTime; @@ -115,6 +116,7 @@ public class Subconscious beforeTime = System.currentTimeMillis(); } + window.dispose(); System.exit(0); } @@ -130,18 +132,18 @@ public class Subconscious } /* listeners */ - public void mousePressed(MouseEvent e) {} - public void mouseReleased(MouseEvent e) {} - public void mouseEntered(MouseEvent e) {} - public void mouseExited(MouseEvent e) {} - public void mouseClicked(MouseEvent e) { + @Override public void mousePressed(MouseEvent e) {} + @Override public void mouseReleased(MouseEvent e) {} + @Override public void mouseEntered(MouseEvent e) {} + @Override public void mouseExited(MouseEvent e) {} + @Override public void mouseClicked(MouseEvent e) { int x = e.getX(); int y = e.getY(); } - public void keyPressed(KeyEvent e) {} - public void keyTyped(KeyEvent e) {} - public void keyReleased(KeyEvent e) { + @Override public void keyPressed(KeyEvent e) {} + @Override public void keyTyped(KeyEvent e) {} + @Override public void keyReleased(KeyEvent e) { int keyCode = e.getKeyCode(); if (keyCode == KeyEvent.VK_Q && e.isControlDown()) { @@ -149,10 +151,10 @@ public class Subconscious } } - public void componentHidden(ComponentEvent e) {} - public void componentShown(ComponentEvent e) {} - public void componentMoved(ComponentEvent e) {} - public void componentResized(ComponentEvent e) { + @Override public void componentHidden(ComponentEvent e) {} + @Override public void componentShown(ComponentEvent e) {} + @Override public void componentMoved(ComponentEvent e) {} + @Override public void componentResized(ComponentEvent e) { dbImage = null; // create new image with the correct size } |