Physics, Gamestates, and Applets

So basically I'm trying to write a FPS in an applet with physics.  Not having too many troubles.  One that I'm having is enabling Physics into an applet.  Since for applets there's only SimpleJMEApplet and SimpleJMEPassApplet, I having a little trouble extending it to allow physics.  I could add the SimplePhysicsGame code to the SimpleJMEApplet code (and I have, which didn't really work for some reason, probably some small bug).  That's not really my problem, I was looking throughout more of JME2 and JME Physics and I noticed Gamestates.  I read Dark Frog's article (very nice), and understand the concept of what these Gamestates do.  My question is whether someone has actually gotten physics to work in applets, through Gamestates? Any help or code is appreciated.    :smiley:

A little side-track question… why don't you use java webstart instead of an applet? It is much more reliable, has fewer restrictions, etc.

enabling jmephysics in SimpleJMEApplet, shouldnt make too much troubles.

Just create a physics space, and render / update it.

Also make sure to update the Timer, as SimpleJmeApplet isn't doing that yet.

import com.jme.bounding.BoundingBox;
import com.jme.math.Vector3f;
import com.jme.scene.shape.Box;
import com.jme.scene.shape.Pyramid;
import com.jme.util.Timer;
import com.jmex.awt.applet.SimpleJMEApplet;
import com.jmex.physics.DynamicPhysicsNode;
import com.jmex.physics.PhysicsSpace;
import com.jmex.physics.StaticPhysicsNode;
import com.jmex.physics.material.Material;

public class TestPhysicsApplet extends SimpleJMEApplet {
   private static final long serialVersionUID = 1L;
   private PhysicsSpace physicsSpace;
   public void init() {
      physicsSpace = PhysicsSpace.create();
   public void simpleAppletRender() {
   public void simpleAppletSetup() {
      Box floor = new Box("floor", new Vector3f(), 50, 1, 50);
      floor.setModelBound(new BoundingBox());
      StaticPhysicsNode floorNode = physicsSpace.createStaticNode();
      floorNode.setLocalTranslation(-20, -3, -20);
      Box box = new Box("box", new Vector3f(), 1,1,1);
      box.setModelBound(new BoundingBox());
      DynamicPhysicsNode boxNode = physicsSpace.createDynamicNode();
      boxNode.setLocalTranslation(0, 30, 0);

      getRootNode().updateGeometricState(0, true);
   public void simpleAppletUpdate() {

Thanks for the code that will help me a lot.  I guess this topic is still open if anyone has figured gamestates for applets.