Mercurial > hg > ristipolku
comparison game/Engine.java @ 44:698c6bcc4aec
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 22 Feb 2011 06:03:51 +0200 |
parents | 9664bbb9d613 |
children | 3e8d1c30f573 |
comparison
equal
deleted
inserted
replaced
43:9664bbb9d613 | 44:698c6bcc4aec |
---|---|
252 if (curr.getType() == PieceType.START) | 252 if (curr.getType() == PieceType.START) |
253 { | 253 { |
254 if (currPiece != null) | 254 if (currPiece != null) |
255 { | 255 { |
256 // Hit center starting piece | 256 // Hit center starting piece |
257 currPiece.setType(PieceType.LOCKED); | |
258 currPiece.setConnectionState(currPiece.getRotatedPoint(currPoint), true); | |
259 | |
260 flagGameOver = true; | 257 flagGameOver = true; |
261 System.out.print("GameOver!\n"); | 258 System.out.print("GameOver!\n"); |
262 break; | 259 break; |
263 } | 260 } |
264 else | 261 else |
265 { | 262 { |
266 System.out.print("first piece\n"); | 263 // Start piece as first piece means game is starting |
267 pieceMoveTo(currPoint); | 264 pieceMoveTo(currPoint); |
268 currPiece = new Piece(PieceType.ACTIVE); | 265 currPiece = new Piece(PieceType.ACTIVE); |
269 board[currX][currY] = currPiece; | 266 board[currX][currY] = currPiece; |
270 return; | 267 return; |
271 } | 268 } |