From 69c2f1f4c93d9257e2a58a2d8b34ee8b4cc6e191 Mon Sep 17 00:00:00 2001 From: forteri76 Date: Tue, 13 May 2014 03:22:09 +0000 Subject: [PATCH] It appears I have fixed the game field synchronization compressor issue during a network game. The compressor must be initialized prior to reconstructing the game field, as moveDown will be nonzero otherwise and cause issues. --- src/org/jfedor/frozenbubble/FrozenGame.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/org/jfedor/frozenbubble/FrozenGame.java b/src/org/jfedor/frozenbubble/FrozenGame.java index b1b6eb7..6558582 100644 --- a/src/org/jfedor/frozenbubble/FrozenGame.java +++ b/src/org/jfedor/frozenbubble/FrozenGame.java @@ -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; @@ -1320,7 +1321,6 @@ private void setGrid() { } } newGrid = null; - compressor.init(); } } @@ -1438,6 +1438,13 @@ public void synchronizeBubbleManager() { /** * If this is a network game, process bubble grid and compressor * synchronization tasks. + *

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 play() function, all + * synchronization tasks will be automatically serviced eventually. + *

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)) {