Anybody here use Groovy? (it's not working for me)

I'm interested in using Groovy with jME for rapid prototyping, but I've run into trouble. I've started with a very simple test:

import com.jme.app.SimpleGame;

import com.jme.math.Vector3f;

import com.jme.scene.shape.Box;



class Main extends SimpleGame {

   public static void main(String[] args) {

        Main myGame = new Main();

        myGame.setConfigShowMode(ConfigShowMode.ShowIfNoConfig); // This line fails

        myGame.start();



   }



    protected void simpleInitGame() {

        Box box1 = new Box("The Box", new Vector3f(0,1,0),1,1,1);

        rootNode.attachChild(box1);

    }



}

This code seems to works fine as Java, but one line fails as Groovy.  :? I thought Groovy was supposed to seamlessly integrate with Java, however even with the "extends SimpleGame" my Main class doesn't appear to have inherited all of the members it's supposed to. Despite searching online for hours I still have no idea what's wrong. How do I fix this?

If you don't get any other replies, let me "volunteer"  }:-@ standtrooper.  He's the author of GBUI and is currently using Groovy with that library.  I know he's busy, so if he doesn't see this thread himself, it might be worth your while to send him a quick PM.

Well I'm doing the same and playing with Groovy and Jme and the first error I notice is your Box declaration. I think you mean to do…



Box box1 = new Box("The Box", new Vector3f(0, 1, 0), new Vector3f(1,1,1));



Also I always comment out this...


myGame.setConfigShowMode(ConfigShowMode.ShowIfNoConfig); // This line fails



As you point out, causes a failure everytime but commenting it out allows you to progress and move on. It's partially a Groovy issue and the way that Jme is implemented.

Ok solved this issue… to use the following code in Groovy…



myGame.setConfigShowMode(ConfigShowMode.ShowIfNoConfig); // This line fails



You have to import AbstractGame and call it like so


myGame.setConfigShowMode(AbstractGame.ConfigShowMode.ShowIfNoConfig); // This line WORKS!!!



Took a bit of reading and playing around but figured it out. Now that works in groovy as well. YAY JAVA!