Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ghostzero/haishin-engine
https://github.com/ghostzero/haishin-engine
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ghostzero/haishin-engine
- Owner: ghostzero
- Created: 2022-09-18T12:04:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-29T21:05:30.000Z (4 months ago)
- Last Synced: 2024-11-24T08:15:33.010Z (2 months ago)
- Language: Java
- Size: 131 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## About
The Haishin Engine is a self-developed game engine for Java based games. It's known for its unique design for
retro games rendered in a 128x64 canvas. The engine is modular and has several features such as music, scene, scheduler
and input management APIs. With a component like scene management, where each scene has its own lifecycle.## Java SDK Installation
```
sudo apt update && sudo apt upgrade -y
sudo apt-get install openjdk-17-jdk
```## Local Development
```
./gradlew publishToMavenLocal
```## Example
```java
package moe.haishin.engine;import lombok.SneakyThrows;
import moe.haishin.engine.input.*;
import moe.haishin.engine.scene.Scene;import java.io.File;
public class App extends Scene {
@SneakyThrows
public static void main(String[] args) {
HaishinEngine engine = HaishinEngine.init(null, new File("assets"), "Haishin Engine Test");
InputManager manager = engine.getInputManager();manager.addInputListeners(new AbstractInputListener() {
@Override
public void buttonUp(Input input, ButtonCode buttonCode) {
System.out.println("Button Up pressed " + buttonCode.name());
}@Override
public void buttonDown(Input input, ButtonCode buttonCode) {
System.out.println("Button Down pressed " + buttonCode.name());
}
});Input input = manager.getKeyboard();
for (InputListener listener : manager.getListeners()) {
listener.buttonUp(input, ButtonCode.A);
listener.buttonUp(input, ButtonCode.A);
listener.buttonUp(input, ButtonCode.A);
}engine.start(new App());
}@Override
public void render(HaishinCanvas c) {
c.clear();
c.drawString(0, 5, "Tick: " + Haishin.getScheduler().getCurrentTick());
}
}
```