Mercurial > hg > ristipolku
comparison game/Engine.java @ 148:5b25561855c3
Move next piece animation call into better place.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 28 May 2012 16:46:41 +0300 |
parents | 0ec311706d3c |
children | d6d92845d6a2 |
comparison
equal
deleted
inserted
replaced
147:0ec311706d3c | 148:5b25561855c3 |
---|---|
342 return false; | 342 return false; |
343 } | 343 } |
344 | 344 |
345 public void animate(float time) | 345 public void animate(float time) |
346 { | 346 { |
347 if (nextPiece != null) | |
348 { | |
349 nextPiece.animate(time); | |
350 } | |
351 | |
347 ptime = time; | 352 ptime = time; |
348 for (int y = 0; y < boardSize; y++) | 353 for (int y = 0; y < boardSize; y++) |
349 for (int x = 0; x < boardSize; x++) | 354 for (int x = 0; x < boardSize; x++) |
350 if (board[x][y] != null) | 355 if (board[x][y] != null) |
351 { | 356 { |
844 // Progress game animation clock | 849 // Progress game animation clock |
845 gameUpdates++; | 850 gameUpdates++; |
846 | 851 |
847 // Animate components | 852 // Animate components |
848 lauta.animate(gameUpdates); | 853 lauta.animate(gameUpdates); |
849 if (lauta.nextPiece != null) | |
850 lauta.nextPiece.animate(gameUpdates); | |
851 | 854 |
852 // Repaint with a frame limiter | 855 // Repaint with a frame limiter |
853 if (gameUpdates % 4 == 1) | 856 if (gameUpdates % 4 == 1) |
854 repaint(); | 857 repaint(); |
855 | 858 |