|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.scripting.ScriptManager
The ScriptManager class handles the invoking of scripted methods. Scripted methods can add functionality to different GameObject notifications for each unique object. For example, the methods for collision notifications for the "player" object are:
playerFloorCollision() playerWallCollision() playerCeilingCollision()Likewise, if "player" collides with the "box" object, these methods are called:
player_boxCollision() player_boxTouch() player_boxRelease()Also, the initLevel() method is called on startup.
Nested Class Summary | |
class |
ScriptManager.ScriptedListener
A GameObjectEventListener that delgates calls to scripted methods. |
Constructor Summary | |
ScriptManager()
|
Method Summary | |
boolean |
hasScripts(GameObject object)
Checks to see if the specified game object has any scripts (check to see if any scripted method starts with the object's name). |
void |
invoke(java.lang.String methodName)
Invokes the specified scripted method. |
boolean |
isMethod(java.lang.String methodName)
Returns true if the specified method name is an exsting scripted method. |
void |
setupLevel(GameObjectManager gameObjectManager,
GameTaskManager gameTaskManager,
java.lang.String[] scriptFiles)
Sets up the ScriptManager for a level. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScriptManager()
Method Detail |
public void setupLevel(GameObjectManager gameObjectManager, GameTaskManager gameTaskManager, java.lang.String[] scriptFiles)
public boolean hasScripts(GameObject object)
public boolean isMethod(java.lang.String methodName)
public void invoke(java.lang.String methodName)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |