- jMonkeyEngine 3.0 Beginner’s Guide
- Ruth Kusterer
- 585字
- 2021-08-13 17:02:05
Time for action – creating a project
The jMonkeyEngine SDK provides you with a preconfigured project template that gets you started at lightning speed.
This is how you create a new project:
- Choose File | New Project from the menu
- Select BasicGame from the jME3 category.
- You can rename the project here, but for now, accept the defaults and complete the wizard.
A new Java project named BasicGame appears in the Projects window, next to the JME3 Tests project.
The BasicGame project contains a simple Main.java
template. Let's try to run this Java application:
- Open the BasicGame project's Source Packages, and double-click on the
mygame/Main.java
file to open it. You see that the JDK contains a full-featured editor for Java files. - Right-click on the BasicGame project and click on Build and Run.
- Accept the default display settings and click on OK.
- The application window opens and shows a blue 3D cube on a black background. If this works, you know that your project is set up correctly.
- Press the Esc key to quit the BasicGame project's window.
As you can see, it's easy to create and run fully preconfigured game projects in the jMonkeyEngine SDK.
What just happened?
Let's open the BasicGame folder in the Projects window and look at the project structure that the SDK has just created for you.
You can see that the Projects window gives you access to three important areas: Project Assets, Source Packages, and Libraries, as well as the build script.

The Projects window shows the logical structure of a jMonkeyEngine project. This view only displays files that you need during development, and it filters out build folders and configuration files. For comparison, have a look at the project's physical structure, which lets you browse the actual files on your hard drive; choose Window | Files from the menu to open the Files window. Click the triangles to open the subsections and compare the two views, as shown in the previous screenshot.
Browse the Libraries section in the Projects window. You can see that it lists all the JAR files that are preconfigured on this project's CLASSPATH
. Compare this to the physical dist/lib
directory in the Files window.
If you know about Ant build scripts, you may want to open the Important Files node in the Projects window and browse the preconfigured Ant targets. Compare this to the physical build file, build.xml
in the Files window.
You will see that a jMonkeyEngine-based application is a standard Java project made up of the following files and folders:

Certain files and folders are automatically created and maintained by the jMonkeyEngine SDK such as build
, dist
, and nbproject
. The SDK recreates these files and folders when you build the application, so do not edit them.
The other folders, highlighted in yellow, contain your sources and assets. Using the test
folder is optional; for now, just ignore it. As in any Java project, you have full control over the project's build.xml
file, and your two main folders, assets
and src
.
Switch back to the Projects window. You see that the Project Assets folder corresponds to jMonkeyProjects/BasicGame/assets/
, and the Source Packages folder corresponds to jMonkeyProjects/BasicGame/src/
. You are free to set up subfolders and packages inside these two folders, as your project requires.
Your Java classes obviously go into Source Packages, but what does the Project Assets folder contain? Open the Project Assets folder and look inside: you will see subfolders for Sounds, Textures, and Models. This folder is where you store your multimedia content.
- Visual Studio 2012 Cookbook
- PHP 7底層設計與源碼實現
- Web Application Development with R Using Shiny(Second Edition)
- 人臉識別原理及算法:動態人臉識別系統研究
- Getting Started with SQL Server 2012 Cube Development
- iOS編程基礎:Swift、Xcode和Cocoa入門指南
- 深入分布式緩存:從原理到實踐
- Python機器學習之金融風險管理
- JavaScript動態網頁編程
- Building Serverless Web Applications
- Applied Deep Learning with Python
- 新手學ASP.NET 3.5網絡開發
- 現代JavaScript編程:經典范例與實踐技巧
- PhoneGap 3.x Mobile Application Development Hotshot
- Developing RESTful Web Services with Jersey 2.0