Mercurial > hg > ristipolku
diff game/Engine.java @ 46:3e8d1c30f573
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 22 Feb 2011 06:42:32 +0200 |
parents | 698c6bcc4aec |
children | 695cf13c103a |
line wrap: on
line diff
--- a/game/Engine.java Tue Feb 22 06:30:11 2011 +0200 +++ b/game/Engine.java Tue Feb 22 06:42:32 2011 +0200 @@ -217,33 +217,33 @@ private void pieceMoveTo(int point) { - switch (point) - { - case 0: currY--; break; - case 1: currY--; break; - - case 2: currX++; break; - case 3: currX++; break; - - case 4: currY++; break; - case 5: currY++; break; - - case 6: currX--; break; - case 7: currX--; break; - } + switch (point) + { + case 0: currY--; break; + case 1: currY--; break; + + case 2: currX++; break; + case 3: currX++; break; + + case 4: currY++; break; + case 5: currY++; break; + + case 6: currX--; break; + case 7: currX--; break; + } } public void pieceFinishTurn() { while (true) { - System.out.print("x="+currX+", y="+currY+", p="+currPoint+"\n"); if (currX >= 0 && currX < boardSize && currY >= 0 && currY < boardSize) { Piece curr = board[currX][currY]; if (curr == null) { + // Create new piece currPiece = new Piece(PieceType.ACTIVE); board[currX][currY] = currPiece; return; @@ -253,7 +253,7 @@ { if (currPiece != null) { - // Hit center starting piece + // Hit center starting piece, game over flagGameOver = true; System.out.print("GameOver!\n"); break; @@ -287,7 +287,7 @@ } else { - // Outside of the board + // Outside of the board, game over flagGameOver = true; System.out.print("GameOver!\n"); break;