Leafy Engine is an engine inspired by HaxeFlixel for making 2D games for the Wii U using Haxe, yes, Haxe!
Important
The engine is still in development, so there may be some bugs, instability and many changes constantly!
A normal Leafy Engine code looks like this:
package src;
import Std;
import leafy.objects.LfSprite;
import leafy.LfState;
import leafy.Leafy;
class PlayState extends LfState {
var sprite:LfSprite;
override public function create():Void {
// Create a sprite
sprite = new LfSprite(100, 100);
sprite.createGraphic(200, 200, [255, 0, 0]);
sprite.center();
addObject(sprite);
var textSprite:LfText = new LfText(0, 0, "Hello World!", 32, "LeafyGame/font.ttf");
textSprite.center();
textSprite.y -= 120;
textSprite.setColor(0, 0, 255);
addObject(textSprite);
}
// Update the sprite position
override public function update(delta:Float):Void {
var moveSpeed:Float = 5;
if (Leafy.wiiuGamepad.pressed(BUTTON_LEFT)) {
sprite.x -= Std.int(moveSpeed * delta * 60);
}
if (Leafy.wiiuGamepad.pressed(BUTTON_RIGHT)) {
sprite.x += Std.int(moveSpeed * delta * 60);
}
if (Leafy.wiiuGamepad.pressed(BUTTON_UP)) {
sprite.y -= Std.int(moveSpeed * delta * 60);
}
if (Leafy.wiiuGamepad.pressed(BUTTON_DOWN)) {
sprite.y += Std.int(moveSpeed * delta * 60);
}
}
}
A code probably similar to one from HaxeFlixel right?
- Wii U Gamepad support
- Wii U Gamepad Buttons and sticks
- Wii U Gamepad Rumble
- Wii U Gamepad Accelerometer
- Wii U Gamepad Gyroscope
- Wii U Gamepad Touchscreen
- Wii U Gamepad Touchscreen touch position and click
- Wii U Gamepad Touchscreen LCD brightness control
- Wii U Gamepad Camera
- Wii U Gamepad Microphone
- Wii U Gamepad home button control
- Objects
- Sprites
- Texts
- buttons (Partially broken)
- Audio support with precise control (Only one music or sound at the same time)
- States
- Substates
- Collisions
- Sprites basic physics
- Tweens and easing functions
- JSONs file support (Only decoding)
- Timers (Using
haxe.Timer
) - HTTP requests (Via CURL)
- Engine rendering modes
- Only on the Wii U Gamepad (->
DRC
) - Only on the TV (->
TV
) - Both (->
UNIQUE
) - Separate rendering (Wii U Gamepad and TV independent at the same time)
- Only on the Wii U Gamepad (->
- FileSystem manipulation
- Engine cameras
This engine uses SDL2 (For the Wii U) as a base, along with other WUT functions. All the libraries are ported to Haxe to work through the @:native
feature, to finally use Reflaxe/C++ to generate the code in C++ and compile it through the DevKitPPC tools, although due to this mode, there are things that change and have more care in how the engine is used when you want to make a project with it.
Haxe has always fascinated me since I met him modifying Friday Night Funkin' from 2022 (The result of that was the Slushi Engine). And there was a time when I was really interested in getting a Nintendo Wii U, I knew it was a console that was not very popular and that kind of thing... But my interest was highly elevated by wanting to make my own homebrew for the console, and I wanted to try Haxe, unfortunately, although there was an attempt to bring Haxe to the Wii U, it was forgotten (Or I think it is only maintained for Nintendo Switch at the moment), besides needing to be registered in the Nintendo Developer Portal, a lot of problems right?.
After months and months, after having managed to make the HxCompileU project stable and viable, I now present, this, Leafy Engine, an engine that will try to be like HaxeFlixel, and create your games on this underrated console.
Read the Getting Started page
If you want to contribute to this project, you can do it by creating a pull request on this repository, test that your changes work both in Cemu and on the real hardware, I would recommend attaching images if it is a change that can be shown.
-
DevkitPro: The base of the homebrew development on Wii U
-
Wii U SDL2 team: The SDL2 port for Wii U
-
SomeRanDev: The creator of reflaxe and Reflaxe/C++, literally the one who made it possible for me to create a game engine for this peculiar console using Haxe
-
Owk: She helped me to make the project logo
-
shima_RAmar (Twitter/X): The artist I used one of his illustrations for the Leafeon that appears in the logo
This project is released under the MIT license