2D Platformer States

I’m currently working on a 2D platformer and I wanted to get some people’s opinions on how to manage states (e.g. idle, walk, run, jump). I’m currently thinking of using the method in Platypus, where the current state is a table of actions set to true or false like this:

local state = {
   idle = true,
   walk = false,
   run = false,
   jump = false
}
1 Like

Platypus is great and I can recommend it to you :wink: however for hero’s state I’m using separate state machine based on https://github.com/kyleconroy/lua-state-machine

The good example is also Lowrez Adventure by @britzl too. It utilizes Platypus and adds an easy too use component system with i.a.stately - a state machine.

1 Like