|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmoagg.game.control.AbstractGameControlImpl
public abstract class AbstractGameControlImpl
| Field Summary | |
|---|---|
protected CollisionHandler |
collisionHandler
|
protected Level |
level
|
protected org.apache.log4j.Logger |
log
|
protected java.util.Map<java.lang.Integer,com.golden.gamedev.object.Timer> |
platformCollisionTimers
For every active player, a Timer is stored which is used to temporarily disable Ship/Platform collisions after take off, which likely occurs when the player is thrusting and rotating simultaneously. |
| Constructor Summary | |
|---|---|
AbstractGameControlImpl()
|
|
| 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 |
addStreamSpeed(Rectangle r,
Vector stream)
This method shall be used to change the stream speed matrix of the playground. |
void |
callScript(java.lang.String name,
java.lang.Object... args)
|
void |
cleanup()
|
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. |
Level |
getLevel()
|
MoaggGameObject |
getObjectById(int id)
|
java.util.List<MoaggGameObject> |
getObjects()
|
protected com.golden.gamedev.object.Timer |
getPlatformCollisionTimer(int id)
|
java.util.List<Platform> |
getPlatforms()
|
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. |
protected void |
initScripting()
|
boolean |
isBackgroundBetween(MoaggGameObject o1,
MoaggGameObject o2)
|
boolean |
isFinished()
|
boolean |
isPlatformCollisionActive(Ship player)
Called by the collision handlers to determine if a detected Ship/Platform collision has to be handled. |
void |
onObjectObjectCollision(MoaggGameObject object1,
MoaggGameObject object2)
|
void |
onObjectPlaygroundCollision(MoaggGameObject object)
|
void |
resetPlatformCollisionTimer(Ship player)
Called by the LandingHandler if a player takes off from a platform. |
void |
update(long elapsedTime)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface moagg.game.control.InternalGameControl |
|---|
addParticle, addProjectile, getGhostsSpriteGroup, getPlayersSpriteGroup, getProjectilesSpriteGroup |
| Methods inherited from interface moagg.game.control.GameControl |
|---|
addObjective, getPlayer, setPopUpText, setPopUpText, setStatusText |
| Field Detail |
|---|
protected org.apache.log4j.Logger log
protected Level level
protected CollisionHandler collisionHandler
protected java.util.Map<java.lang.Integer,com.golden.gamedev.object.Timer> platformCollisionTimers
| Constructor Detail |
|---|
public AbstractGameControlImpl()
| Method Detail |
|---|
protected void initScripting()
public void cleanup()
public void update(long elapsedTime)
update in interface InternalGameControlpublic Level getLevel()
getLevel in interface InternalGameControl
public void addGravity(Rectangle r,
Vector gravity)
GameControl
addGravity in interface GameControlr - A Rectangle indexing the tiles of the playground to change.gravity - The gravity increment.
public void addStreamSpeed(Rectangle r,
Vector stream)
GameControl
addStreamSpeed in interface GameControlr - A Rectangle indexing the tiles of the playground to change.stream - The stream speed increment.
public void addFriction(Rectangle r,
double friction)
GameControl
addFriction in interface GameControlr - A Rectangle indexing the tiles of the playground to change.friction - The friction increment.public Vector getGravityFor(MoaggGameObject object)
GameControl
getGravityFor in interface GameControlobject - The game object to determine the gravity for.
public Vector getStreamSpeedFor(MoaggGameObject object)
GameControl
getStreamSpeedFor in interface GameControlobject - The game object to determine the stream speed for.
public double getFrictionFor(MoaggGameObject object)
GameControl
getFrictionFor in interface GameControlobject - The game object to determine the friction for.
public java.util.List<Platform> getPlatforms()
getPlatforms in interface InternalGameControlpublic java.util.List<MoaggGameObject> getObjects()
getObjects in interface InternalGameControlpublic MoaggGameObject getObjectById(int id)
getObjectById in interface GameControlid - The id of the game object to return.
public boolean isBackgroundBetween(MoaggGameObject o1,
MoaggGameObject o2)
isBackgroundBetween in interface InternalGameControlprotected com.golden.gamedev.object.Timer getPlatformCollisionTimer(int id)
public void resetPlatformCollisionTimer(Ship player)
InternalGameControl
resetPlatformCollisionTimer in interface InternalGameControlplayer - The player who took of a platform.public boolean isPlatformCollisionActive(Ship player)
InternalGameControl
isPlatformCollisionActive in interface InternalGameControlplayer - The player who collided with a Platform.
public void onObjectPlaygroundCollision(MoaggGameObject object)
onObjectPlaygroundCollision in interface InternalGameControl
public void onObjectObjectCollision(MoaggGameObject object1,
MoaggGameObject object2)
onObjectObjectCollision in interface InternalGameControlpublic void finish()
GameControl
finish in interface GameControlpublic boolean isFinished()
public void callScript(java.lang.String name,
java.lang.Object... args)
callScript in interface InternalGameControl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||