News for hackers. Stuff that matters.
Re:Many games are held together by duct tape by _the_inflator on Wednesday January 15, 2020 @12:30PM (#22056186)
And it works! I learned a lot about preventing magic with this here: https://gameprogrammingpatterns.com/state.html

For me - and I mostly do frontend apps now - I always advise to go for state pattern instead of complex if/thens. Thanks to the aforementioned article.

Re:Many games are held together by duct tape by lzralbu on Wednesday January 15, 2020 @12:59PM (#22056537)
Does Redux help with things like this?
Re:Many games are held together by duct tape by davidkpiano on Wednesday January 15, 2020 @01:48PM (#22057113)
If you have enough discipline, sure. Finite state machine tools like XState are more strict about this.