If you no longer have the BasicGame
template open, open it again in the jMonkeyEngine SDK. Remember that you can always recreate this project template using the New Project wizard in the File menu.
Let's look at the main class of the BasicGame
project:
Open the
BasicGame
project in the Projects window.Double-click on the
mygame/Main.java
file in theSource Packages
folder.Main.java
opens in the source editor.When you look at the
Main.java
template, you see a standard Java class that extends thecom.jme3.app.SimpleApplication
class.SimpleApplication
is the base class that we use to write all our 3D games.
The basic code sample is short enough so that you can type it yourself—we just use the BasicGame
template because it is quicker:
import com.jme3.app.SimpleApplication; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; import com.jme3.math.Vector3f; import com.jme3.renderer.RenderManager; import com.jme3.scene.Geometry; import...