summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-02-07 22:03:22 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-02-07 22:03:22 -0500
commit3724f4ecbe61e6621d4a7e993cd80ab75ee41266 (patch)
tree7701709896cdb261c9c1a2e89cf240f57b18e6b1 /src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java
parentb2b180730ad252b4a8d15d9bc59895b56c552c29 (diff)
downloadfourpuzzle-3724f4ecbe61e6621d4a7e993cd80ab75ee41266.tar.gz
fourpuzzle-3724f4ecbe61e6621d4a7e993cd80ab75ee41266.tar.bz2
fourpuzzle-3724f4ecbe61e6621d4a7e993cd80ab75ee41266.zip
Added TurnLeft and TurnRight AnimationTypes
Also implemented opposite(), left() and right() functions for Direction which return the opposite, counterclockwise and clockwise directions respectively. I don't exactly like the current Direction implementation as it's not very elegant. Hopefully there is a way to make this prettier.

Also added a setter to PossibleEvent that allows LayerEvent to notify it when it starts or stops moving. This is necessary because the TurnLeft and TurnRight AnimationTypes constantly attempt to rotate the Event and if the Direction of the Event is changed while it is moving, it will move to a different space and animation will look strange. Thus, setDirection() has been modified so it will disallow direction change if the Event is moving.

Also fixed a small encapsulation bug in AbstractEvent. PossibleEvent's notification of movement was made possible through the overriding of the setMoving() function, which is used by AbstractEvent to set if the Event is currently moving. However, while it used setMoving() to turn on moving, previously it did not use it to turn off moving, it simply modified the field. This has been fixed.
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java')
-rw-r--r--src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java index 3283da5..3acfff4 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java
@@ -134,7 +134,7 @@ public class MapViewGameState implements GameState {
134 { 134 {
135 if (Functions.isFacing(hero, ev)) 135 if (Functions.isFacing(hero, ev))
136 { 136 {
137 ev.setDirection(hero.getDirection().oppositeDirection()); 137 ev.setDirection(hero.getDirection().opposite());
138 ev.getCallback().activate(ev.getCalltime()); 138 ev.getCallback().activate(ev.getCalltime());
139 } 139 }
140 } else { 140 } else {