You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been thinking about these transition problems a bit and the way we pass values around from state to state to preserve state can be improved. At the moment we use the msgDictionary with arbitrary variables and rely on each state to know what to do with it.
I think we're at a point where we could introduce a player/hook state Dictionary that's internally kept in each state we create and it's passed around when transitioning form one state to the other. This way it would be less of a hassle to correctly set say velocity after hook is used when hitting the ground. Not only that, but it would make save/load simpler too.
We could also have partial state updates from state to state, for example if the death state doesn't affect velocity (which shouldn't) then we just pass relevant Dictionary parts to it and not the entire variable.
This internal state that represents all variables affecting the player/hook at any one point, like velocity, etc could be thought of like the "contract" that the states use and it possibly simplifies keeping track of changes made (from dev. point of view)
I've been thinking about these transition problems a bit and the way we pass values around from state to state to preserve state can be improved. At the moment we use the
msg
Dictionary
with arbitrary variables and rely on each state to know what to do with it.I think we're at a point where we could introduce a player/hook state
Dictionary
that's internally kept in each state we create and it's passed around when transitioning form one state to the other. This way it would be less of a hassle to correctly set say velocity after hook is used when hitting the ground. Not only that, but it would make save/load simpler too.We could also have partial state updates from state to state, for example if the death state doesn't affect velocity (which shouldn't) then we just pass relevant
Dictionary
parts to it and not the entire variable.This internal state that represents all variables affecting the player/hook at any one point, like velocity, etc could be thought of like the "contract" that the states use and it possibly simplifies keeping track of changes made (from dev. point of view)
Originally posted by @razcore-art in #150 (comment)
The text was updated successfully, but these errors were encountered: