org.deken.game.trigger
Class LocationTrigger
java.lang.Object
org.deken.game.trigger.Trigger
org.deken.game.trigger.LocationTrigger
- All Implemented Interfaces:
- Updateable
public class LocationTrigger
- extends Trigger
Title: LocationTrigger
Description: This class watches an Actor, and fires off when the Actor
reaches certain locations. This trigger is set to check for an exact tile
location. Setting the exact to false, will cause this trigger to fire off if
the Actor is only within the tile.
Copyright: Copyright (c) Sep 1, 2012
- Version:
- 1.0
- Author:
- Gary Deken
Method Summary |
void |
checkTrigger(long elapseTime)
Checks if the Actor is at the location, and if so, triggers the listeners,
then stops this trigger from executing again. |
void |
reset()
Resets this Trigger so that it can be invoked again. |
void |
setTileXY(int[] tileXY)
Set the tile locations, to watch if the Actor lands on them. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocationTrigger
public LocationTrigger(Actor watch,
MapSize mapSize)
- Parameters:
watch
- mapSize
-
LocationTrigger
public LocationTrigger(Actor watch,
int tileX,
int tileY,
MapSize mapSize)
- Parameters:
watch
- tileX
- tileY
- mapSize
-
LocationTrigger
public LocationTrigger(Actor watch,
int[] tileXY,
MapSize mapSize)
- Parameters:
watch
- tileXY
- mapSize
-
checkTrigger
public void checkTrigger(long elapseTime)
- Checks if the Actor is at the location, and if so, triggers the listeners,
then stops this trigger from executing again.
- Specified by:
checkTrigger
in class Trigger
- Parameters:
elapseTime
-
reset
public void reset()
- Description copied from class:
Trigger
- Resets this Trigger so that it can be invoked again.
- Overrides:
reset
in class Trigger
setTileXY
public void setTileXY(int[] tileXY)
- Set the tile locations, to watch if the Actor lands on them.
- Parameters:
tileXY
-