https://github.com/de-nuc/Nuc
Lightweight Cross-platform 2D game framework
https://github.com/de-nuc/Nuc
2d cross-platform engine framework game haxe kha lightweight
Last synced: 2 months ago
JSON representation
Lightweight Cross-platform 2D game framework
- Host: GitHub
- URL: https://github.com/de-nuc/Nuc
- Owner: de-nuc
- License: zlib
- Created: 2021-01-26T23:10:34.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-02T13:44:00.000Z (about 2 years ago)
- Last Synced: 2025-03-02T08:49:21.806Z (2 months ago)
- Topics: 2d, cross-platform, engine, framework, game, haxe, kha, lightweight
- Language: Haxe
- Homepage:
- Size: 2.12 MB
- Stars: 15
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
Nuc is a lightweight cross-platform, 2d game framework.
Build on top of [Kha](https://github.com/Kode/Kha) framework using [Haxe](https://haxe.org/) language.
## Installation
- Install [Kha](https://github.com/Kode/Kha/wiki/Getting-Started)
- Init Kha Project
- Clone Nuc to your project folder:
```bash
git clone https://github.com/nuclibs/Nuc.git
```
- Open [khafile.js](https://github.com/Kode/Kha/wiki/khafile.js) from your project folder and add this lines:```js
let p = new Project("New Project");await p.addProject("Nuc");
p.addSources("Sources");
p.addShaders("Shaders");
p.addAssets(
"Assets/**",
{
nameBaseDir: "Assets",
destination: "Assets/{dir}/{name}",
name: "{dir}/{name}",
noprocessing: true,
notinlist: true
}
);resolve(p);
```
## Minimal example
```haxeimport nuc.Resources;
import nuc.Window;
import nuc.events.AppEvent;
import nuc.events.RenderEvent;
import nuc.graphics.SpriteBatch;
import nuc.graphics.Camera;
import nuc.graphics.Texture;class Game {
var camera:Camera;
var sb:SpriteBatch;
var parrotImage:Texture;public function new() {
Resources.loadAll(
[
'parrot.png'
],
ready
);
}function ready() {
App.on(AppEvent.UPDATE, update);
App.on(RenderEvent.RENDER, render);camera = new Camera(Window.width, Window.height);
camera.clearColor = new Color(0.2, 0.2, 0.2, 1.0);sb = new SpriteBatch();
parrotImage = Resources.getTexture('parrot.png');
}function update(elapsed:Float) {
}
function render(e:RenderEvent) {
camera.begin();sb.drawImage(parrotImage);
camera.end();
}
}```
---
This framework is in development and is not ready for production.
I'm using it for my own projects and if you like this project and you want to contribute, feel free to do so.