diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event')
3 files changed, 14 insertions, 1 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/AbstractEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/AbstractEvent.java index 7e8dd0d..483ce49 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/AbstractEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/AbstractEvent.java | |||
@@ -50,6 +50,11 @@ public abstract class AbstractEvent implements Event { | |||
50 | 50 | ||
51 | setDirection(toMove); | 51 | setDirection(toMove); |
52 | 52 | ||
53 | if (getDirection() != toMove) | ||
54 | { | ||
55 | return false; | ||
56 | } | ||
57 | |||
53 | if (!getParentMap().checkForCollision(this, toMove)) | 58 | if (!getParentMap().checkForCollision(this, toMove)) |
54 | { | 59 | { |
55 | setAnimationStep(2); | 60 | setAnimationStep(2); |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/LayerEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/LayerEvent.java index b31705d..530af6f 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/LayerEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/LayerEvent.java | |||
@@ -9,7 +9,6 @@ import com.fourisland.fourpuzzle.Layer; | |||
9 | import java.awt.Graphics; | 9 | import java.awt.Graphics; |
10 | import java.util.ArrayList; | 10 | import java.util.ArrayList; |
11 | import com.fourisland.fourpuzzle.Direction; | 11 | import com.fourisland.fourpuzzle.Direction; |
12 | import com.fourisland.fourpuzzle.gamestate.mapview.Map; | ||
13 | import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.BlankEventGraphic; | 12 | import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.BlankEventGraphic; |
14 | 13 | ||
15 | /** | 14 | /** |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java index 2ee4dca..df4f4ee 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEventThread.java | |||
@@ -36,6 +36,15 @@ public class MoveEventThread implements Runnable { | |||
36 | 36 | ||
37 | public void run() | 37 | public void run() |
38 | { | 38 | { |
39 | while (ev.isMoving()) | ||
40 | { | ||
41 | try { | ||
42 | Thread.sleep(2); | ||
43 | } catch (InterruptedException ex) { | ||
44 | Logger.getLogger(MoveEventThread.class.getName()).log(Level.SEVERE, null, ex); | ||
45 | } | ||
46 | } | ||
47 | |||
39 | events.add(ev); | 48 | events.add(ev); |
40 | 49 | ||
41 | MoveEventThread.countMoveEventThreads++; | 50 | MoveEventThread.countMoveEventThreads++; |