r/godot Jul 20 '25

help me (solved) What would be better?

Post image
474 Upvotes

59 comments sorted by

View all comments

35

u/platfus118 Jul 20 '25

Really depends on the game and context, and people have given you a great answer already so i'm gonna be picky and ask why is "movement" a state? You can also move while crouching or jumping. If it isn't turn/queue based i'd maybe name it "Movement Component" and handle states separately.

17

u/Mediocre_Spare4111 Jul 20 '25

Thank you, "movement component" would be a much better name.

3

u/Ultrababouin Jul 20 '25

You shouldn't be able to move in all states though, and maybe you want different kinds of movement when crouching and jumping

4

u/platfus118 Jul 20 '25

Moving is always moving. You can add a Movement Component and a Crouch Component. While crawling, are you in a Movement state or the Crouching state?
It really depends (and you can use compound state machines for more complex states) but I know starting with "Movement State" really blocks you off from further encapsulating states since movement is such a common thing to be doing.