Hi everyone.
I've been working on a top-down tank game that makes use of the 8-Direction behaviour for player movement.
Additionally, I'm using animations to precisely determine the direction the tank would be facing when the player hit's the arrow keys.
Following is the screenshot of the events that control this.
The issue here is that the tank sprite turns instantly towards the corresponding selected direction. Instead of this, I'm looking to incorporate a system where I would like the sprite to rotate smoothly in 40-degree intervals towards the direction the arrow key is being pressed. For example, if the tank is facing up, and the player presses the down arrow key, I want the tank to rotate smoothly in 40-degree intervals until it faces down and then start moving. Hope someone would be able to help.