Converting from jME to jMEphysics game

I've been perfectly content using just jME…no physics. Then I realized that eventually, I would need it, and the farther I was when I decided to add it the harder it would be. So, I imported the correct things, changed "initGame" to "simpleInitGame" and "update" to "simpleUpdate". However, when I run my game, I get the following error…


SEVERE: Exception in game loop
java.lang.NullPointerException
   at com.jme.app.BaseSimpleGame.initGame(Unknown Source)
   at com.jme.app.BaseGame.start(Unknown Source)
   at projectNormal.Start.main(Start.java:137)
Aug 22, 2007 6:18:49 PM com.jme.app.BaseGame start
INFO: Application ending.



Please help, and thank you  :D

So you were extending BaseGame and are now extending SimplePhysicsGame? That's most probably not what you want. Simply leave your game class like it was before (no changed superclass), create a PhysicsSpace in initGame (see SimplePhysicsGame) and update it in the update method. The source of SimplePhysicsGame is really short - just have a look at it and incorporate what you need into your game class.



SimplePhysicsGame is a replacement for SimpleGame to get you started. If you already have an own game class you don't need it.

On the jME physics wiki, there is a class called BasePhysicsGame, which implements this physics space already, you might wish to use it.