Top Related Projects
Desktop/Android/HTML5/iOS Java game development framework
LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
Godot Engine – Multi-platform 2D and 3D game engine
Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
Quick Overview
jMonkeyEngine is a powerful, open-source 3D game engine written in Java. It provides a comprehensive set of tools and features for creating high-quality 3D games and applications, including a robust rendering engine, physics simulation, audio support, and a scene graph system.
Pros
- Cross-platform compatibility (Windows, macOS, Linux, Android)
- Extensive documentation and active community support
- Built-in physics engine (jBullet) and integration with other physics libraries
- Flexible and extensible architecture allowing for custom shaders and plugins
Cons
- Steeper learning curve compared to some other game engines
- Limited visual editor capabilities compared to Unity or Unreal Engine
- Smaller ecosystem of third-party assets and plugins
- Performance may not be as optimized as C++-based engines for high-end games
Code Examples
- Creating a simple cube:
Box box = new Box(1, 1, 1);
Geometry geometry = new Geometry("Box", box);
Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
material.setColor("Color", ColorRGBA.Blue);
geometry.setMaterial(material);
rootNode.attachChild(geometry);
- Adding basic input handling:
inputManager.addMapping("Shoot", new KeyTrigger(KeyInput.KEY_SPACE));
inputManager.addListener((ActionListener) (name, isPressed, tpf) -> {
if (name.equals("Shoot") && isPressed) {
shoot();
}
}, "Shoot");
- Implementing a simple physics simulation:
BulletAppState bulletAppState = new BulletAppState();
stateManager.attach(bulletAppState);
RigidBodyControl boxPhysics = new RigidBodyControl(1.0f);
geometry.addControl(boxPhysics);
bulletAppState.getPhysicsSpace().add(boxPhysics);
Getting Started
- Add jMonkeyEngine dependency to your project (e.g., using Gradle):
dependencies {
implementation 'org.jmonkeyengine:jme3-core:3.5.2-stable'
implementation 'org.jmonkeyengine:jme3-desktop:3.5.2-stable'
implementation 'org.jmonkeyengine:jme3-lwjgl:3.5.2-stable'
}
- Create a basic application:
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
public class HelloJME3 extends SimpleApplication {
public static void main(String[] args) {
HelloJME3 app = new HelloJME3();
app.start();
}
@Override
public void simpleInitApp() {
Box box = new Box(1, 1, 1);
Geometry geometry = new Geometry("Box", box);
Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
material.setColor("Color", ColorRGBA.Blue);
geometry.setMaterial(material);
rootNode.attachChild(geometry);
}
}
Run the application to see a blue cube rendered in a 3D environment.
Competitor Comparisons
Desktop/Android/HTML5/iOS Java game development framework
Pros of libGDX
- Cross-platform development for desktop, mobile, and web
- Lightweight and flexible, allowing for more control over the development process
- Large and active community with extensive third-party libraries and tools
Cons of libGDX
- Steeper learning curve for beginners compared to jMonkeyEngine
- Less built-in support for 3D graphics and physics
- Requires more manual setup and configuration for complex projects
Code Comparison
libGDX:
public class MyGame extends ApplicationAdapter {
@Override
public void create() {
// Game initialization code
}
}
jMonkeyEngine:
public class MyGame extends SimpleApplication {
@Override
public void simpleInitApp() {
// Game initialization code
}
}
Summary
libGDX is a versatile, lightweight game development framework that offers cross-platform support and flexibility. It has a large community and extensive third-party resources. However, it may require more manual setup and has a steeper learning curve compared to jMonkeyEngine. jMonkeyEngine, on the other hand, provides better built-in support for 3D graphics and physics, making it more suitable for certain types of projects. The choice between the two depends on the specific requirements of your game and your development preferences.
LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
Pros of LWJGL
- Lower-level API, offering more control and flexibility
- Lighter weight, with potentially better performance
- Supports a wider range of graphics APIs (OpenGL, Vulkan, OpenAL, etc.)
Cons of LWJGL
- Steeper learning curve, requiring more boilerplate code
- Lacks built-in game engine features (physics, scene graph, etc.)
- Requires manual management of game loop and rendering pipeline
Code Comparison
LWJGL basic window creation:
GLFWErrorCallback.createPrint(System.err).set();
if (!glfwInit()) throw new IllegalStateException("Unable to initialize GLFW");
long window = glfwCreateWindow(300, 300, "Hello World!", NULL, NULL);
glfwMakeContextCurrent(window);
GL.createCapabilities();
jMonkeyEngine basic application:
public class SimpleApplication extends SimpleApplication {
@Override
public void simpleInitApp() {
Box b = new Box(1, 1, 1);
Geometry geom = new Geometry("Box", b);
rootNode.attachChild(geom);
}
}
LWJGL provides a lower-level API with more control but requires more setup, while jMonkeyEngine offers a higher-level abstraction with built-in game engine features, simplifying development for beginners but potentially limiting flexibility for advanced users.
Godot Engine – Multi-platform 2D and 3D game engine
Pros of Godot
- More user-friendly interface and visual scripting options
- Broader platform support, including web and mobile
- Larger and more active community, with frequent updates
Cons of Godot
- Steeper learning curve for developers familiar with Java
- Less flexible for low-level engine modifications
- Limited support for large-scale, AAA-type game development
Code Comparison
jMonkeyEngine (Java):
public class HelloWorld extends SimpleApplication {
public static void main(String[] args) {
HelloWorld app = new HelloWorld();
app.start();
}
}
Godot (GDScript):
extends Node2D
func _ready():
print("Hello, World!")
Both engines offer different approaches to game development. jMonkeyEngine provides a more traditional Java-based framework, while Godot offers a more integrated environment with its own scripting language. Godot's visual scripting and scene system make it more accessible for beginners, but jMonkeyEngine's Java foundation may be preferable for developers with strong Java backgrounds or those working on projects that require deep engine customization.
Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
Pros of cocos2d-x
- Multi-platform support (iOS, Android, Windows, macOS, Linux)
- Extensive documentation and large community
- Faster development for 2D games
Cons of cocos2d-x
- Limited 3D capabilities compared to jMonkeyEngine
- Steeper learning curve for C++ beginners
- Less suitable for complex 3D projects
Code Comparison
jMonkeyEngine (Java):
public class HelloWorld extends SimpleApplication {
public static void main(String[] args) {
HelloWorld app = new HelloWorld();
app.start();
}
}
cocos2d-x (C++):
class HelloWorld : public cocos2d::Scene {
public:
static cocos2d::Scene* createScene();
virtual bool init();
CREATE_FUNC(HelloWorld);
};
jMonkeyEngine focuses on 3D game development with Java, offering a more straightforward approach for Java developers. It provides robust 3D capabilities and is well-suited for complex 3D projects.
cocos2d-x, on the other hand, excels in 2D game development across multiple platforms using C++. It offers a rich set of tools and features for creating 2D games quickly but may require more effort for 3D projects.
Both engines have active communities and documentation, but cocos2d-x has a larger user base due to its multi-platform nature and popularity in mobile game development.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
jMonkeyEngine
jMonkeyEngine is a 3-D game engine for adventurous Java developers. Itâs open-source, cross-platform, and cutting-edge. v3.6.1 is the latest stable version of the engine.
The engine is used by several commercial game studios and computer-science courses. Here's a taste:
- jME powered games on IndieDB
- Boardtastic 2
- Attack of the Gelatinous Blob
- Mythruna
- PirateHell (on Steam)
- 3089 (on Steam)
- 3079 (on Steam)
- Lightspeed Frontier (on Steam)
- Skullstone
- Spoxel (on Steam)
- Nine Circles of Hell (on Steam)
- Leap
- Jumping Jack Flag
- PapaSpace Flight Simulation
- Cubic Nightmare (on Itch)
- Chatter Games
- Exotic Matter
- Demon Lord (on Google Play)
- Marvelous Marbles (on Steam)
- Boxer (on Google Play)
- Depthris (on Itch)
- Stranded (on Itch)
- The Afflicted Forests (Coming Soon to Steam)
- Star Colony: Beyond Horizons (on Google Play)
- High Impact (on Steam)
Getting Started
Go to https://github.com/jMonkeyEngine/sdk/releases to download the jMonkeyEngine SDK. Read the wiki for the installation guide and tutorials. Join the discussion forum to participate in our community, get your questions answered, and share your projects.
Note: The master branch on GitHub is a development version of the engine and is NOT MEANT TO BE USED IN PRODUCTION.
Technology Stack
- windowed, multi-platform IDE derived from NetBeans
- libraries for GUI, networking, physics, SFX, terrain, importing assets, etc.
- platform-neutral core library for scene graph, animation, rendering, math, etc.
- LWJGL v2/v3 (to access GLFW, OpenAL, OpenGL, and OpenVR) or Android or iOS
- Java Virtual Machine (v8 or higher)
Documentation
Did you miss it? Don't sweat it, here it is again.
Contributing
Read our contribution guide.
License
Top Related Projects
Desktop/Android/HTML5/iOS Java game development framework
LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
Godot Engine – Multi-platform 2D and 3D game engine
Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot