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

Can you explain this code? It just doesn't make sense to me. #44

Open
deckarep opened this issue Oct 15, 2024 · 3 comments
Open

Can you explain this code? It just doesn't make sense to me. #44

deckarep opened this issue Oct 15, 2024 · 3 comments

Comments

@deckarep
Copy link

Hi @rapiz1,

I know you haven't updated this project in awhile and I know this is a long shot: Do you happen to know why you decrement this pointer to a texture?

ani->origin--;

I just don't understand why you'd want to do it. Also, the comments make a note that it's dangerous!

I love this project, and I'm working on a FULL PORT, to be released very soon!

Thank you!

-deckarep

@rapiz1
Copy link
Owner

rapiz1 commented Oct 16, 2024

This is likely because textures are guaranteed to be stored in a particular order. You can try to trace how textures for heroes are loaded. I guess that the decrement here is to get a different orientation of the same hero character.

@deckarep
Copy link
Author

deckarep commented Oct 16, 2024

Thank you for confirming this, after thinking this through I came to a similar conclusion but was second guessing myself.

Hopefully I can keep it in my version. I’ll follow up with you when it’s released and I hope you wouldn’t mind adding it to your README.md file.

@deckarep
Copy link
Author

I just open sourced the port. It's built in the language Zig: https://github.com/deckarep/dungeon-rush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants