Having completed it, I would to know why the method that sets up the the blue cube walk-through is duplicated. It appears in Main and in HelloJME3. Did I do something wrong? I feel I can’t proceed until I understand this.
My guess… is that it tells him to create a simple game project which will already have its own Main class. The tutorial doesn’t tell you to delete the one that comes with the default project. Most people would know to do this automatically but very new developers won’t know this, I guess.
Thanks for your replies and patience. In the very first tutorial, “Create a project” I complete these first steps:
1. Choose File→New Project… from the main menu.
2. In the New Project wizard, select the template JME3→Basic Game. Click Next.
3. Specify a project name, e.g. “HelloWorldTutorial
4. Specify a path where to store your new project, e.g. a jMonkeyProjects directory in your home directory.
5. Click Finish.
After that, the IDE shows the source code of the package mygame, and the class public class Main extends SimpleApplication {}
In that class is a method called public void simpleInitApp() which contains a few lines of code to set up the blue cube walkthrough:
After that the next tutorial is “Extend SimpleApplication”:
In the jMonkeyEngine SDK:
Right-click the Source Packages node of your project.
Choose New…→Java Class to create a new file.
Enter the class name: HelloJME3
Enter the package name: jme3test.helloworld.
Click Finish.
The SDK creates the file HelloJME3.java for you.
There is then a code sample to paste in which is in essence identical to the Main class mentioned above, but this package is called jme3test.helloworld with a class is called HelloJME3.
So when I get there, I have two different packages with the same content. I understand now (from pspeed) we are supposed to delete mygame (or replace the code in it). So I guess I was just confused by the approach because when I hit the run button in the editor, it was executing the Main class, not the HelloJM3. That meant changes I made to the scene parameters didn’t show.
Incidently, it did leave me wondering how one can set the main class when the are two classes with main methods…