A state-based Luxe Template

sign up sign in

I've recently created a new template for Luxe, based off the Snowkit template by Chman.

For those of you who came from massively popular HaxeFlixel, I'm sure you would notice the similarity. HaxeFlixel arguably has one of the most effective template I've seen to date, allowing dev to jump right into working from a pre-made structure that can easily be turned into a full game.

Noticably, luxe.States is highly optional, and many games have been created without it. Luxe is apparently not heavily built around the state-based structure the way HaxeFlixel/Flixel is. While I personally do find many benefits working this way, not everyone has to. This is not meant to be the default that would come pre-packaged with Luxe one day (though I'd be highly flattered if it is somehow). I also hope that I managed to explain the way Luxe does a couple of things differently to new folks.

The current template is now rather minimal, but does a number of things that I want:

  • Allowing easy customization of game size in Main.hx via variable declaration.
  • Setting the initial state in the same place, like HaxeFlixel does (though a bit unintuitive).
  • Creating the state machine luxe.States and add the two existing luxe.States.State to it (do remember to add yours if you need additional states).
  • A handful of comments in Project.flow that will hopefully make your first setup easier.

Things I don't like at the moment:

  • App.config is incomplete, mainly due to my unfamiliarity with the engine.
  • The way all states has to be declared first hand in Main.hx.
  • The way I have to use State.name to switch state via state machine, which is a bit unintuitive and confusing sometimes IMO.

But all in all, this is a work in progress, and I look forward to your feedback. At the moment, this is mainly for me and I hope that you also find it useful somehow.

If you are further interested in Luxe state machine, it was also mentioned in alpha-2.0 focus sheet post which is also available in the repo.

If you are using this template, do let me know what I can do to improve it.

Tags
luxetemplate