YieldEngine
A powerful scene-oriented JVM game engine, created with the objective of being a simple and efficient engine for creating 2d games in Java ☕
Install / Use
/learn @yield-proj/YieldEngineREADME
<a href="https://yield-proj.github.io/YieldEngine/index.html" target="_blank">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-javadoc-brightgreen.svg" />
</a>
<a href="http://www.apache.org/licenses/" target="_blank">
<img alt="License: Apache License 2.0" src="https://img.shields.io/badge/License-Apache License 2.0-yellow.svg" />
</a>
🎮 A 2D cross-platform game engine
A powerful scene-oriented JVM game engine☕, created with the objective of being a simple and efficient engine for creating 2d games in any JVM capable language. The engine can produce executables capable of running in a number of platforms, including the major desktop platforms (Linux, macOS, Windows), and mobile platforms in the future 😉.
🏠 Website
🪧 Hello, World! Demo
🪪 Documentation
The Yield Engine documentation is hosted on github websites and is contained in this repository. Check the docs or Check the docs folder.
Core Repository Structure
core/
└── src/main/java/com/xebisco/yieldengine/core/
├── Scene.java # Core scene management
├── Entity.java # Base entity class for game objects
├── Component.java # Base component class for entity behaviors
├── components/ # Built-in components for common functionality
│ ├── AudioEmitter.java # Spatial audio source component
│ ├── AudioListener.java # Audio receiver component
│ ├── Rectangle.java # 2D rectangle rendering
│ ├── Sprite.java # 2D image rendering
│ └── Text.java # Text rendering
├── graphics/ # Graphics system implementation
│ └── yldg1/ # Primary graphics implementation
├── input/ # Input handling system
└── io/ # Resource management (textures, audio, fonts)
Quick Start
- Create a basic game scene:
Scene gameScene = new Scene();
gameScene.setBackgroundColor(new Color4f(0.2f, 0.3f, 0.8f));
Global.setCurrentScene(gameScene);
- Add entities to the scene:
Entity player = new Entity(new EntityHeader("Player"), new Transform());
player.addComponents(new Rectangle().setColor(new Color4f(1, 0, 0)));
gameScene.getEntities().add(player);
- Start the game loop:
LoopContext loop = Global.getOpenGLOpenALLoopContext(800, 600);
gameScene.create();
loop.run();
More Detailed Examples
- Creating a sprite with texture:
Texture texture = IO.getInstance().loadTexture("path/to/image.png");
Entity sprite = new Entity(new EntityHeader("Sprite"), new Transform());
sprite.addComponents(new Sprite(texture));
- Adding audio to a scene:
Audio audio = IO.getInstance().loadAudio("path/to/sound.ogg");
Entity emitter = new Entity(new EntityHeader("Emitter"), new Transform());
emitter.addComponents(new AudioEmitter(audio, true));
Data Flow
The engine processes game data through a component-based entity system, managing rendering and updates through a scene graph.
[Input] -> [Scene Controller] -> [Entity Updates] -> [Component Processing]
|
v
[Resource Manager] <- [Graphics/Audio] <- [Render Queue]
Component interactions:
- Scene/SceneController manages entity lifecycle and updates
- Entities contain components and maintain hierarchical relationships
- Components handle specific behaviors (rendering, audio, physics)
- Graphics system processes render queue using YLDG1 implementations
- Resource manager(IO) handles asset loading and unloading
- Input system provides keyboard and mouse state updates
- Audio system manages spatial audio through emitter/listener components
😁 Getting the engine
Compiled jars
A compiled version of every main release is hosted here on github, check Releases, to choose witch version of the engine to download.
Compile it yourself
If you really want, you can also compile the YieldEngine to fit your needs.
Contributing
Contributions, issues and feature requests are welcome!🤝<br />To start take a look at the contributing guide.
📝 License
Copyright © 2023 Xebisco. This project is Apache License 2.0 licensed 📝.
Author
👤 Xebisco
- Website: xebisco.com
- Twitter: @Xebisco
- Github: @Xebisco
- LinkedIn: Vítor Toledo de Oliveira
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
