Skip to content

Commit

Permalink
It appears I have fixed the game field synchronization compressor iss…
Browse files Browse the repository at this point in the history
…ue during a network game. The compressor must be initialized prior to reconstructing the game field, as moveDown will be nonzero otherwise and cause issues.
  • Loading branch information
forteri76 committed May 13, 2014
1 parent cf1affb commit 69c2f1f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/org/jfedor/frozenbubble/FrozenGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1300,11 +1300,12 @@ else if (result == gameEnum.LOST)

private void setGrid() {
if (newGrid != null) {
bubbleManager.initialize();
removeAllBubbleSprites();
compressor.init();
falling.clear();
goingUp.clear();
jumping.clear();
bubbleManager.initialize();
removeAllBubbleSprites();
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 13; j++) {
bubblePlay[i][j] = null;
Expand All @@ -1320,7 +1321,6 @@ private void setGrid() {
}
}
newGrid = null;
compressor.init();
}
}

Expand Down Expand Up @@ -1438,6 +1438,13 @@ public void synchronizeBubbleManager() {
/**
* If this is a network game, process bubble grid and compressor
* synchronization tasks.
* <p>To prevent the appearance of glitches, do not synchronize the
* game field while a launched bubble is in motion. Since this method
* is called in every loop of the <code>play()</code> function, all
* synchronization tasks will be automatically serviced eventually.
* <p>Note that during game initialization, there is never a launch
* bubble in motion, so a call to this method at that time will always
* immediately perform any necessary synchronization tasks.
*/
private void synchronizeNetworkGame() {
if ((movingBubble == null) && (networkManager != null)) {
Expand Down

0 comments on commit 69c2f1f

Please sign in to comment.