Skip to content

Commit

Permalink
Tally total moves
Browse files Browse the repository at this point in the history
  • Loading branch information
hubbu committed Mar 31, 2012
1 parent 6e66053 commit 5289fc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion pm-desktop/src/com/ivanarellano/game/pm/Board.java
Expand Up @@ -5,7 +5,6 @@ public class Board {
public static final int COLS = 3;

public Tile[][] tiles = new Tile[ROWS][COLS];
public int totalMoves;
public String goal = new String("123456780");

public int btRow = 0;
Expand Down
Expand Up @@ -22,6 +22,7 @@ public class GameScreen extends PmScreen {
Group groupBoard = new Group("board");
Group groupTiles = new Group("tiles");
public Image grassBoard = new Image(Assets.atlas.findRegion("grassboard"));
public int totalMoves = 0;

public GameScreen(PmGame game) {
super(game);
Expand All @@ -45,6 +46,7 @@ public void update(float delta) {
public void completed(Action action) {
board.slideTile(Direction.LEFT);
state = GameState.READY;
totalMoves++;
}
});

Expand All @@ -60,6 +62,7 @@ public void completed(Action action) {
public void completed(Action action) {
board.slideTile(Direction.RIGHT);
state = GameState.READY;
totalMoves++;
}
});

Expand All @@ -76,6 +79,7 @@ public void completed(Action action) {
public void completed(Action action) {
board.slideTile(Direction.DOWN);
state = GameState.READY;
totalMoves++;
}
});

Expand All @@ -92,6 +96,7 @@ public void completed(Action action) {
public void completed(Action action) {
board.slideTile(Direction.UP);
state = GameState.READY;
totalMoves++;
}
});

Expand Down

0 comments on commit 5289fc7

Please sign in to comment.