Skip to content

An game engine inspired by HaxeFlixel for making 2D games for the Wii U using Haxe!

License

Notifications You must be signed in to change notification settings

Slushi-Github/leafyEngine

Repository files navigation

Leafy Engine

The first 2D game engine for the Wii U made with Haxe!

Leafy Engine Logo

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!

Leafy Engine Docs

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?

Current status of the engine:

  • 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)
  • FileSystem manipulation
  • Engine cameras

How?

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.

Why?

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.

Using the engine

Read the Getting Started page

Contributing

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.

Credits

License

This project is released under the MIT license

About

An game engine inspired by HaxeFlixel for making 2D games for the Wii U using Haxe!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Languages