Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hero: refactor movement code for efficiency #89

Open
jorgegv opened this issue Aug 23, 2022 · 0 comments
Open

hero: refactor movement code for efficiency #89

jorgegv opened this issue Aug 23, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jorgegv
Copy link
Owner

jorgegv commented Aug 23, 2022

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)

@jorgegv jorgegv added the enhancement New feature or request label Aug 23, 2022
@jorgegv jorgegv added this to the Release 0.6.0 milestone Aug 23, 2022
@jorgegv jorgegv self-assigned this Aug 23, 2022
@jorgegv jorgegv modified the milestones: Release 0.6.0, Release 0.7.0 Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant