Re: Love2D: a simple, featureful game engine for most platforms

So essentially what I'm doing is:

* I use Lovetoys as an ECS. You get some great library names with this, I'll say that. I was briefly evaluating the Gspot GUI library.
* Lovetoys handles my actual game objects. If Lovetoys isn't updating, the game isn't updating.
* I use Luigi for my GUI. Luigi uses a Layout to store all widgets associated with the currently-displayed GUI.
* If there's a `gui` variable set to a non-nil value, love.update() doesn't run engine:update() (I.e. the ECS update procedure) so the game is effectively paused.
* I thought about using a menu stack, but realistically I don't really need it. I just need a single previous layout. My nested layout screens just check for the presence of that. If it's set, display it and then set it to nil.

So in short, love.load() displays my start menu and sets the `gui` variable to that layout. Clicking Start clears that, initializes the ECS engine instance, at which point love.update() starts updating the ECS on each game tick. Pressing escape creates the in-game menu GUI, sets gui to that layout, and stops calling the ECS update procedures. It also dispatches a Pause event, which pauses any playing sounds on any entities marked with the Pausable component.

You really don't need a complex state-tracking system--at least, not initially. You also really don't need every ounce of performance for an audio game--at least, not initially. I remember playing GMA Tank Commander and Shades of Doom on an old referbished low-end Pentium laptop running Windows XP. But if you ever *do* need that, Love lets you rewrite hot code paths in LuaJIT's FFI module to call directly into C. There are also a few game state systems which I might adopt if I ever find I need them. But for now, everything is in cleanly-defined functions that are all just a few lines long and easy to follow. It's about shipping product, not creating an architectural marvel. smile

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : nolan via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector

Reply via email to