public class GameWorld
extends java.lang.Object
Constructor and Description |
---|
GameWorld(android.content.Context context,
WeatherStatus status)
initialises a new game world by reading in game config files and the database
|
Modifier and Type | Method and Description |
---|---|
void |
addNewObject(GameObject obj)
adds a new object to the world during runtime
|
void |
addObject(GameObject obj)
adds a new object to the world at initialisation time
|
void |
addPlatform(GameObject obj)
adds a new platform to the tile map
|
GameObject |
getAttack()
returns the attack according to the current weather state by cloning an old one, also used for drop downs
|
GameObject |
getCamera() |
java.util.List<GameObject> |
getEntities() |
java.util.List<GameObject> |
getMap() |
int |
getNumTilesH() |
int |
getNumTilesV() |
GameObject |
getPlayer() |
GameState |
getState() |
void |
setAttackNormal(GameObject attackNormal) |
void |
setAttackSpecial(GameObject attackSpecial) |
void |
setCamera(GameObject camera) |
void |
setPlayer(GameObject player) |
void |
update(double elapsedTime)
updates all entities in the world
the tile map is static and therefore not updated
|
public GameWorld(android.content.Context context, WeatherStatus status)
context
- the games context eg. the activitystatus
- the weather status of the worldpublic void update(double elapsedTime)
elapsedTime
- the time difference since the last updatepublic void addObject(GameObject obj)
obj
- the object to addpublic void addNewObject(GameObject obj)
obj
- the object to addpublic void addPlatform(GameObject obj)
obj
- the platform object to addpublic java.util.List<GameObject> getEntities()
public java.util.List<GameObject> getMap()
public int getNumTilesH()
public int getNumTilesV()
public GameObject getPlayer()
public void setPlayer(GameObject player)
public GameObject getCamera()
public void setCamera(GameObject camera)
public GameState getState()
public GameObject getAttack()
public void setAttackNormal(GameObject attackNormal)
public void setAttackSpecial(GameObject attackSpecial)