moagg.game.control
Interface GameControl

All Known Subinterfaces:
InternalGameControl
All Known Implementing Classes:
AbstractGameControlImpl, MultiPlayerClientGameControlImpl, MultiPlayerServerGameControlImpl, SinglePlayerGameControlImpl

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

addGravity

void addGravity(Rectangle r,
                Vector gravity)
This method shall be used to change the gravity matrix of the playground.

Parameters:
r - A Rectangle indexing the tiles of the playground to change.
gravity - The gravity increment.

addStreamSpeed

void addStreamSpeed(Rectangle r,
                    Vector stream)
This method shall be used to change the stream speed matrix of the playground.

Parameters:
r - A Rectangle indexing the tiles of the playground to change.
stream - The stream speed increment.

addFriction

void addFriction(Rectangle r,
                 double friction)
This method shall be used to change the friction matrix of the playground.

Parameters:
r - A Rectangle indexing the tiles of the playground to change.
friction - The friction increment.

getGravityFor

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.

Parameters:
object - The game object to determine the gravity for.
Returns:
The gravity vector of the given game object.

getStreamSpeedFor

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.

Parameters:
object - The game object to determine the stream speed for.
Returns:
The stream speed vector of the given game object.

getFrictionFor

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.

Parameters:
object - The game object to determine the friction for.
Returns:
The friction of the given game object.

getPlayer

Ship getPlayer()
Returns:
The player's ship.

addObjective

void addObjective(Objective objective)
Parameters:
objective - The objective to add.

getObjectById

MoaggGameObject getObjectById(int id)
Parameters:
id - The id of the game object to return.
Returns:
The game object with the given id, or null if no such object exists.

setStatusText

void setStatusText(java.lang.String text)
Parameters:
text - The text to display in the status line.

setPopUpText

void setPopUpText(java.lang.String key)
Stores a text for being displayed in a pop-up window.

Parameters:
key - The key to use for the properties lookup.

setPopUpText

void setPopUpText(java.lang.String key,
                  java.lang.Object... args)
Stores a text for being displayed in a pop-up window.

Parameters:
key - The key to use for the properties lookup.
args - Optional arguments to be filled into the text.

finish

void finish()
If this method is called, the currently played level will end.



Copyright © 2008. All Rights Reserved.