kidscancode / godot_recipes

Lessons, tutorials, and guides for game development using the Godot game engine.
MIT License
239 stars 37 forks source link

8 direction: Convenience edits #114

Closed DeeJayLSP closed 1 year ago

DeeJayLSP commented 2 years ago

posmod() does the same thing as wrapi() by assuming the min arg is 0. Since only zeroes are used as args here, it's better to change to that.

Also compressed 10 lines of code related to directional input into a single one (thanks to 3.4) that does the exact same thing to reduce if pollution.