Game Development Reference
In-Depth Information
rootNode.detachChild(levelNode);
}
levelNode = (Node)
assetManager.loadModel("Scenes/"+levelName + ".j3o");
rootNode.attachChild(levelNode);
return null;
}
});
}
8. We need to make sure we manipulate the scene graph at the correct moment in
time so that we can detach and attach the node inside an enqueue block.
9. Finally, we make sure MessageListener picks up LoadLevelMessage as
follows:
else if (m instanceof LoadLevelMessage){
gameClient.loadLevel(((LoadLevelMessage)m).getLevelName());
game.setLevelName(((LoadLevelMessage)m).getLevelName());
}
10. That's it! When we connect to the server again, we should see a familiar scene.
Search WWH ::




Custom Search