From simpleGame to gamestate

im trying to convert from SimpleGame to GameState for my game … everything(model loaded with texture, terrain etc) seems ok in SimpleGame but when i extends GameState instead, problems occured! model is in but texture problem and the terrain has gone totally white with the skydome black … anyone knows roughly what/where the problem is? need help  :’(

SimpleGame provides Light and a LightState for example, the missing Light is causing your Objects to be plain white.

You can look into BaseSimpleGame.initGame() Method to see how to set up a default Light.

Alternatively you could extend DebugGameState

While adapting various jmetest examples to gamestate I found that with Gamestate you have to call this after you set everything up.


I think it's because you initialize things after having called game.start()

PS: I Just created a new login but I have been following JME since 2004 :wink:

yup… lightstate stuffs is the only codes i have commented out … i guess that is the source of the problem and still looking for a solution for that… at the same time … haha NOMIS solved the problem with one line of code!!! thankz man … and thankz everyone also who is willing help … thankz alot!!!  i lov this forum!!! XD

omg!!! i have another problem now … i trying to put gamestate2 on top of gamestate1 … i already create gamestate2 right after gamestate one and set both to active … but i only can see gamestate2 for a few sec, then it is totally covered by gamestate1 … any ideas?  :oops:

                    GameState ingame = new IngameState("ingame");




                    GameState fengState = new MenuState("menu");



It should work if you add the FengGUI State after the InGameState. But you do this already i guess.

it work in this example: Wiki: FengGUI GameState

Another solution would be to use a separate RenderPass f

hmmmm … not sure what happen … but i have switched to HUD instead … haha … i got what i want now … thankz everyone!  :smiley:

hey … im trying to change from simpleGame to CameraGameState … actually is the third person controller test available in the jme examples… but when i have done so, i cant move the object as it can when using simpleGame … can still respond to the mouse input but not the keyboard … any idea guys?  please … :expressionless: