summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-02-03 21:11:23 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-02-03 21:11:23 -0500
commit029190712a8f38cef760741cf53652e0ccd89172 (patch)
treebf1a01b9103592f4dda7511e9b23913bbbd98870 /src/com/fourisland/fourpuzzle/gamestate/mapview
parentce6ae1b56e4f6548dc19974474c8ee2d8cece13a (diff)
downloadfourpuzzle-029190712a8f38cef760741cf53652e0ccd89172.tar.gz
fourpuzzle-029190712a8f38cef760741cf53652e0ccd89172.tar.bz2
fourpuzzle-029190712a8f38cef760741cf53652e0ccd89172.zip
Started working on new Transitions
The old transition implementation was old and patchy. The new one is planned to be extensible and to work properly with all transitions. Currently this is not so, but with work it hopefully will be.
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview')
-rw-r--r--src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java index faa7a48..cf31bf1 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java
@@ -13,6 +13,8 @@ import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.AutomaticViewpoint;
13import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.FixedViewpoint; 13import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.FixedViewpoint;
14import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.MovingViewpoint; 14import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.MovingViewpoint;
15import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.Viewpoint; 15import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.Viewpoint;
16import com.fourisland.fourpuzzle.transition.InTransition;
17import com.fourisland.fourpuzzle.transition.OutTransition;
16import java.util.concurrent.CountDownLatch; 18import java.util.concurrent.CountDownLatch;
17 19
18/** 20/**
@@ -149,9 +151,33 @@ public class SpecialEvent {
149 throw new UnsupportedOperationException("Not yet implemented"); 151 throw new UnsupportedOperationException("Not yet implemented");
150 } 152 }
151 153
154 private boolean startedTransition = false;
155
156 /**
157 * Displays a transition from the current map to emptiness
158 *
159 * If this method is executed before Teleport(), Teleport() will not use
160 * the database-default out transition and instead immeditatly jump to the
161 * new map. It will also not use the database-default in transition which
162 * requires you to also execute EndTransition().
163 *
164 * @param trans The transition to use
165 * @throws InterruptedException
166 */
167 public void StartTransition(OutTransition trans) throws InterruptedException
168 {
169 startedTransition = true;
170
171 Display.transition(trans);
172 }
173
152 /** 174 /**
153 * Moves the player to a different map 175 * Moves the player to a different map
154 * 176 *
177 * If StartTransition() is executed prior to this method, then this will
178 * not preform the database-default transitions, which requires that
179 * EndTransition() is executed after this method.
180 *
155 * @param map The name of the map to move to 181 * @param map The name of the map to move to
156 * @param x The X position on the map to move to 182 * @param x The X position on the map to move to
157 * @param y The Y position on the map to move to 183 * @param y The Y position on the map to move to
@@ -162,6 +188,24 @@ public class SpecialEvent {
162 } 188 }
163 189
164 /** 190 /**
191 * Displays a transition from the emptiness to the new map
192 *
193 * This method is only required if you called StartTransition() before
194 * Teleport(), in which case it will display the transition. Otherwise,
195 * this action will do nothing.
196 *
197 * @param trans
198 * @throws InterruptedException
199 */
200 public void EndTransition(InTransition trans) throws InterruptedException
201 {
202 if (startedTransition)
203 {
204 Display.transition(trans);
205 }
206 }
207
208 /**
165 * Waits for a specified interval 209 * Waits for a specified interval
166 * 210 *
167 * @param wait The time to wait in milliseconds 211 * @param wait The time to wait in milliseconds