amykatname / newhorizons

Port of the Penguin game to HaxeFlixel
https://discord.gg/2wGgTJcPt9
3 stars 5 forks source link

Rework PlaySate Update and Input logic. #10

Closed marvhus closed 4 days ago

marvhus commented 5 days ago

The current implementation of PlayState.update (and the surrounding code) is difficult to read and maintain. It contains a lot of tangled logic and relies heavily on multiple boolean flags, which makes it challenging to understand the state transitions.

I am currently working on refactoring this code to improve its structure. The goal is to reduce the complexity by:

You can track my progress on this refactor in my fork.

This work is still in progress, so any suggestions on how to improve this refactor are very welcome!

marvhus commented 4 days ago

Update

The goal of this has slightly changed. Now it will be to extract code out of PlayState and make it be more sensible rather than just rewriting PlayState. Progress of this can be seen in the playerstate-rewrites branch.