Skip to content

Commit

Permalink
Fixed synchronization issue at game startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
forteri76 committed May 13, 2014
1 parent cf4b976 commit cf1affb
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/org/jfedor/frozenbubble/FrozenGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -909,14 +909,9 @@ else if (fixedBubbles == 7) {
}

/*
* If this is a network game, process bubble grid and compressor
* synchronization tasks.
* Perform game synchronization tasks.
*/
if ((movingBubble == null) && (networkManager != null)) {
setGrid();
lowerCompressorSteps(newSteps == 1);
}

synchronizeNetworkGame();
synchronizeBubbleManager();

/*
Expand Down Expand Up @@ -1336,6 +1331,7 @@ public void setGrid(byte[][] newGrid) {
this.newGrid[i][j] = newGrid[i][j];
}
}
synchronizeNetworkGame();
}

public void setLaunchBubbleColors(int current, int next, int newNext) {
Expand Down Expand Up @@ -1439,6 +1435,17 @@ public void synchronizeBubbleManager() {
}
}

/**
* If this is a network game, process bubble grid and compressor
* synchronization tasks.
*/
private void synchronizeNetworkGame() {
if ((movingBubble == null) && (networkManager != null)) {
setGrid();
lowerCompressorSteps(newSteps == 1);
}
}

public void updatePenguinState(double dx) {
if (dx < 0) {
penguin.updateState(PenguinSprite.STATE_TURN_LEFT);
Expand Down

0 comments on commit cf1affb

Please sign in to comment.