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
The current movement code consists of several code paths, which are very similar and only differ in that the checks are done for a few variables, and they act on only a couple of them.
They can probably be refactored in some generic code which can be used to do checks from a table and act on the coordinates according to that table.
This would make easy also to enable explicit 8-direction movement (i.e. diagonal and straight) and reduce the amount of code.
Also, this would make conditional compile for either 4- or 8-direction movement trivial (i.e. a table with just 4 or 8 checks)
The text was updated successfully, but these errors were encountered:
The current movement code consists of several code paths, which are very similar and only differ in that the checks are done for a few variables, and they act on only a couple of them.
They can probably be refactored in some generic code which can be used to do checks from a table and act on the coordinates according to that table.
This would make easy also to enable explicit 8-direction movement (i.e. diagonal and straight) and reduce the amount of code.
Also, this would make conditional compile for either 4- or 8-direction movement trivial (i.e. a table with just 4 or 8 checks)
The text was updated successfully, but these errors were encountered: