|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimogl.level.AbstractLevel
public abstract class AbstractLevel
This class represents a world (level)
Field Summary | |
---|---|
static java.util.ArrayList<AbstractGameObject> |
buildings
|
static java.util.ArrayList<AbstractGameObject> |
characters
|
Fog |
fog
|
static Food |
food
|
static Gold |
gold
|
static java.util.ArrayList<Light> |
lights
|
static java.util.ArrayList<AbstractParticleEffect> |
partEffects
|
static java.util.ArrayList<Rain> |
rainSources
|
SkyBox |
skyBox
|
static Terrain |
terrain
|
static MeshDL |
waterLayer
|
static java.util.ArrayList<AbstractMesh> |
worldItemsSolid
|
static java.util.ArrayList<AbstractMesh> |
worldItemsTransparent
|
Constructor Summary | |
---|---|
AbstractLevel(javax.media.opengl.GL gl,
int amountGold,
int amountFood)
Creates a new level with the specified initial values for gold and food for the player |
Method Summary | |
---|---|
void |
createRain(int mapSize,
int distance)
Call this method, if you would like to add a rain effect to your level. |
void |
createSkybox(javax.media.opengl.GL gl,
java.lang.String north,
java.lang.String south,
java.lang.String east,
java.lang.String west,
java.lang.String top,
java.lang.String bottom)
This method must be called to create the world's skybox |
void |
createTerrain(javax.media.opengl.GL gl,
java.lang.String mapPath,
int size,
int resolution,
com.sun.opengl.util.texture.Texture texture)
Call this method to create the world's terrain from a heightmap file. |
abstract void |
createTextures()
This method must be overridden to initialize the textures for the concrete world. |
void |
createWaterLayer(javax.media.opengl.GL gl,
int size,
float yPos,
com.sun.opengl.util.texture.Texture texture)
This method must be called to create the water layer of the world. |
abstract void |
createWorldContent(javax.media.opengl.GL gl)
This is the central method that should be used to create all world content. |
void |
draw(javax.media.opengl.GL gl,
long elapsedTime)
Draws the world to the screen |
static boolean |
isEnabledRain()
Static method that determines whether the rain effect is enabled or disabled |
static void |
setEnabledRain(boolean enableRain)
Static method to enable or disable the rain effect of the level |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.ArrayList<AbstractGameObject> characters
public static java.util.ArrayList<AbstractGameObject> buildings
public static java.util.ArrayList<AbstractMesh> worldItemsSolid
public static java.util.ArrayList<AbstractMesh> worldItemsTransparent
public static java.util.ArrayList<AbstractParticleEffect> partEffects
public static java.util.ArrayList<Rain> rainSources
public static java.util.ArrayList<Light> lights
public static Gold gold
public static Food food
public Fog fog
public SkyBox skyBox
public static Terrain terrain
public static MeshDL waterLayer
Constructor Detail |
---|
public AbstractLevel(javax.media.opengl.GL gl, int amountGold, int amountFood)
gl
- amountGold
- initial amount of gold for the playeramountFood
- initial amount of food for the playerMethod Detail |
---|
public abstract void createWorldContent(javax.media.opengl.GL gl)
gl
- public abstract void createTextures()
this.texWall = TextureIO.newTexture(rsLoader.getFile("./textures/wall.png"), true);
this.texSand = TextureIO.newTexture(rsLoader.getFile("./textures/sand.png"), true);
public void createSkybox(javax.media.opengl.GL gl, java.lang.String north, java.lang.String south, java.lang.String east, java.lang.String west, java.lang.String top, java.lang.String bottom)
gl
- north
- filepath+filename for northern texturesouth
- filepath+filename for southern textureeast
- filepath+filename for eastern texturewest
- filepath+filename for western texturetop
- filepath+filename for top texturebottom
- filepath+filename for bottom texturepublic void createTerrain(javax.media.opengl.GL gl, java.lang.String mapPath, int size, int resolution, com.sun.opengl.util.texture.Texture texture)
gl
- mapPath
- path+filename to the height map filesize
- pixel width/height of the height map fileresolution
- resolution factor for parsing the height map filetexture
- the texture that ought to be wrapped over the terrainpublic void createRain(int mapSize, int distance)
mapSize
- size of the level's height mapdistance
- distance between the rain sourcespublic void createWaterLayer(javax.media.opengl.GL gl, int size, float yPos, com.sun.opengl.util.texture.Texture texture)
gl
- size
- width/length of the water layer. Should be the same size as
the terrain's height map pixel width/heightyPos
- defines the sea level, i.e. the height level of the water
surfacetexture
- a texture that ought to be wrapped onto the water surfacepublic static void setEnabledRain(boolean enableRain)
enableRain
- enable rain? --> true=yes, false=nopublic static boolean isEnabledRain()
public void draw(javax.media.opengl.GL gl, long elapsedTime)
gl
- elapsedTime
- time between two frames
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |