public class StandardGameHelloExample{
private Skybox sb = null;
public static void main(String[] args) {
StandardGame app = new StandardGame("HelloExample");
app.setDialogBehaviour(0);
app.start();
GameState gameState2 = new GameState(); // Create our game state
GameStateManager.getInstance().attachChild(gameState2); // Attach it to the GameStateManager
gameState2.setActive(true); // Activate it
/**
TerrainManager manager = new TerrainManager();
// First a hand made terrain
rootNode.attachChild(manager.getHomegrownTerrainBlock());
// Next an automatically generated terrain with a texture
rootNode.attachChild(manager.getHeightmapterrainblock());
// Finally a terrain loaded from a greyscale image with fancy textures on it.
rootNode.attachChild(manager.getComplexTerrainBlock());
*/
// initialize the SkyboxManager
// this needs to be called once, before you can get() the manager
SkyBoxManager.init([u]cam[/u]);
rootNode.attachChild(SkyBoxManager.get().getCreatedSkyBox());
//Move the skybox into position to the location of the camera so it moves with it
SkyBoxManager.get().update();
GameState is abstract, use something like BasicGameState instead, and there are a bunch of variables you haven't declared… the javac error messages are fairly self explanatory?
i understand a bit i changed it to BasicGameState gameState2 = new BasicGameState(null);
but the only 2 things are cam and rootNode do i have to declare them in standard game ? i just basically copy and pasted the one i had using SimpleGame.
public class HelloExample extends SimpleGame {
private Skybox sb = null;
public static void main(String[] args) {
HelloExample app = new HelloExample();
app.setDialogBehaviour(AbstractGame.NEVER_SHOW_PROPS_DIALOG);
app.start();
}
protected void simpleInitGame() {
/**
TerrainManager manager = new TerrainManager();
// First a hand made terrain
rootNode.attachChild(manager.getHomegrownTerrainBlock());
// Next an automatically generated terrain with a texture
rootNode.attachChild(manager.getHeightmapterrainblock());
// Finally a terrain loaded from a greyscale image with fancy textures on it.
rootNode.attachChild(manager.getComplexTerrainBlock());
*/
// initialize the SkyboxManager
// this needs to be called once, before you can get() the manager
SkyBoxManager.init(cam);
rootNode.attachChild(SkyBoxManager.get().getCreatedSkyBox());
}
@Override
protected void simpleUpdate() {
//Move the skybox into position to the location of the camera so it moves with it
SkyBoxManager.get().update();
}
}
The rootnode comes from the game state, the camera comes from standardgame. You should take a look at the javadocs for BasicGameState and StandardGame: http://www.jmonkeyengine.com/doc/