|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GameControl
This interface represents the parts of the game control interface exposed to level scripting.
| Method Summary | |
|---|---|
void |
addFriction(Rectangle r,
double friction)
This method shall be used to change the friction matrix of the playground. |
void |
addGravity(Rectangle r,
Vector gravity)
This method shall be used to change the gravity matrix of the playground. |
void |
addObjective(Objective objective)
|
void |
addStreamSpeed(Rectangle r,
Vector stream)
This method shall be used to change the stream speed matrix of the playground. |
void |
finish()
If this method is called, the currently played level will end. |
double |
getFrictionFor(MoaggGameObject object)
Since the playground's friction may vary depending on the game object's position, this method shall be used to determine the object's current friction factor. |
Vector |
getGravityFor(MoaggGameObject object)
Since the playground's gravity may vary depending on the game object's position, this method shall be used to determine the object's current gravity vector. |
MoaggGameObject |
getObjectById(int id)
|
Ship |
getPlayer()
|
Vector |
getStreamSpeedFor(MoaggGameObject object)
Since the playground's stream speed may vary depending on the game object's position, this method shall be used to determine the object's current stream speed vector. |
void |
setPopUpText(java.lang.String key)
Stores a text for being displayed in a pop-up window. |
void |
setPopUpText(java.lang.String key,
java.lang.Object... args)
Stores a text for being displayed in a pop-up window. |
void |
setStatusText(java.lang.String text)
|
| Method Detail |
|---|
void addGravity(Rectangle r,
Vector gravity)
r - A Rectangle indexing the tiles of the playground to change.gravity - The gravity increment.
void addStreamSpeed(Rectangle r,
Vector stream)
r - A Rectangle indexing the tiles of the playground to change.stream - The stream speed increment.
void addFriction(Rectangle r,
double friction)
r - A Rectangle indexing the tiles of the playground to change.friction - The friction increment.Vector getGravityFor(MoaggGameObject object)
object - The game object to determine the gravity for.
Vector getStreamSpeedFor(MoaggGameObject object)
object - The game object to determine the stream speed for.
double getFrictionFor(MoaggGameObject object)
object - The game object to determine the friction for.
Ship getPlayer()
void addObjective(Objective objective)
objective - The objective to add.MoaggGameObject getObjectById(int id)
id - The id of the game object to return.
void setStatusText(java.lang.String text)
text - The text to display in the status line.void setPopUpText(java.lang.String key)
key - The key to use for the properties lookup.
void setPopUpText(java.lang.String key,
java.lang.Object... args)
key - The key to use for the properties lookup.args - Optional arguments to be filled into the text.void finish()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||