Mercurial > hg > ristipolku
diff game/Engine.java @ 26:3d4cc47df31a
Cleanups, fix piece rendering and rotation.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 01 Feb 2011 19:18:25 +0200 |
parents | bbac3e4a4b9b |
children | 26adc2827983 |
line wrap: on
line diff
--- a/game/Engine.java Tue Feb 01 18:05:19 2011 +0200 +++ b/game/Engine.java Tue Feb 01 19:18:25 2011 +0200 @@ -365,6 +365,7 @@ public void keyPressed(KeyEvent e) { + // Handle keyboard input switch (e.getKeyCode()) { case KeyEvent.VK_LEFT: @@ -389,20 +390,23 @@ { while (animEnable) { + // Progress game animation clock gameClock++; + // Animate components lauta.animate(gameClock); + // Repaint with a frame limiter if (gameClock % 3 == 1) { repaint(); gameFrames++; } - + + // Sleep for a moment try { Thread.sleep(10); } - catch (InterruptedException x) { } }