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

[Discussion] 8-Directional Movement/Animation #100

Open
cbscribe opened this issue Jun 27, 2021 · 2 comments
Open

[Discussion] 8-Directional Movement/Animation #100

cbscribe opened this issue Jun 27, 2021 · 2 comments
Labels
discussion A thread for questions and comments.

Comments

@cbscribe
Copy link
Member

Discussion for http://godotrecipes.com/2d/8_direction/

@cbscribe cbscribe added the discussion A thread for questions and comments. label Jul 19, 2021
@justdaft
Copy link

justdaft commented Nov 22, 2021

Hi I cant seem to get direction number 4, when I try the code in the keyboard input section.

@justdaft
Copy link

I fixed it by adding
a = stepify(input_dir.angle() , PI/4) / (PI/4)
a = wrapi(int(a), 0, 8)
to the keyboard-input code section, I copied the way you did it in the mouse control section.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion A thread for questions and comments.
Projects
None yet
Development

No branches or pull requests

2 participants