simogl.level
Class DemoLevel

java.lang.Object
  extended by simogl.level.AbstractLevel
      extended by simogl.level.DemoLevel

public class DemoLevel
extends AbstractLevel


Field Summary
 
Fields inherited from class simogl.level.AbstractLevel
buildings, characters, fog, food, gold, lights, partEffects, rainSources, skyBox, terrain, waterLayer, worldItemsSolid, worldItemsTransparent
 
Constructor Summary
DemoLevel(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 createTextures()
          This method must be overridden to initialize the textures for the concrete world.
 void createWorldContent(javax.media.opengl.GL gl)
          This is the central method that should be used to create all world content.
 
Methods inherited from class simogl.level.AbstractLevel
createRain, createSkybox, createTerrain, createWaterLayer, draw, isEnabledRain, setEnabledRain
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DemoLevel

public DemoLevel(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

Parameters:
gl -
amountGold - initial amount of gold for the player
amountFood - initial amount of food for the player
Method Detail

createTextures

public void createTextures()
Description copied from class: AbstractLevel
This method must be overridden to initialize the textures for the concrete world. The texture objects have to be global class variables, that can be similarily instanciated like this in your overridden createTextures()-method :
this.texWall = TextureIO.newTexture(rsLoader.getFile("./textures/wall.png"), true);
this.texSand = TextureIO.newTexture(rsLoader.getFile("./textures/sand.png"), true);

You will have to put a try-catch-block around the code in order to handle IOExceptions

Specified by:
createTextures in class AbstractLevel

createWorldContent

public void createWorldContent(javax.media.opengl.GL gl)
Description copied from class: AbstractLevel
This is the central method that should be used to create all world content. This is the place where the world objects that have been defined as global class variables can be instaciated. Some world items that usually appear in every scene can be created by convinience methods, such as createSkybox(), createTerrain(), createWaterLayer()

Specified by:
createWorldContent in class AbstractLevel