Hello all,
Seeing how I'm sick atm. I finally have some time to work on this again, but I've run into a lttle problem here.
I created a MapperState, this uses XML to create a space map.
Now, I add this to the GameStateManager and all works as it should. Next I want to add a MouseLook to be able to look around at the objects I placed in space via the mapper. I can't seem to get this to work however, probably because I'm doing something wrong here.
This is what I have thus far in my initGame method:
protected final void initGame() {
instance = this;
display.setTitle("Test Game State System");
// Creates the GameStateManager. Only needs to be called once.
GameStateManager.create();
// Adds a new GameState to the GameStateManager. In order for it to get
// processed (rendered and updated) it needs to get activated.
GameState map;
try {
map = new MapperState("BasicMapState",
"/resources/applicationContext.xml");
map.setActive(true);
GameStateManager.getInstance().attachChild(map);
} catch (Throwable e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
input = new MouseLookHandler(cam, 1);
//input.addAction(new MouseTargetAction(), InputHandler.DEVICE_MOUSE, 0, InputHandler.AXIS_NONE, false);
}
and the update method
protected final void update(float interpolation) {
// Recalculate the framerate.
timer.update();
tpf = timer.getTimePerFrame();
// Update the current game state.
GameStateManager.getInstance().update(tpf);
}
I hope someone out there can give me a heads up on where I'm going wrong, cause I can't seem to find it.
Mark