I created a sprite that moves in 8 directions with the arrows, now I would also like to use the WASD keys. I can make it move right, left, up and down with the animations but when I press for example WD for the right corner, the sprite moves towards the corner but the animation is stopped at frame 0.
In the red box are animations that don't work with corners.
You have button hold events triggered simultaneously.
This is for left,right,up,down. If I go diagonally how can i use this animation?
(deleted, see below)
I created a simple example, it seems logical to me.
Develop games in your browser. Powerful, performant & highly capable.
Ok you're right about this. But when the sprite moves diagonally, I want to use a custom animation. For example in the right diagonal, I don't want to use the "right" animation but a custom one.
I don't understand what prevents you from replacing the test animations with your own?
This is the second variant, here without angle detection but only by button presses.
Sorry, I'm wrong. This way it's simpler and it seems to work, thanks! But I only have one doubt, I'm trying to use 3 frames in the LU animation but in the diagonal I only see the first frame. I have the loop enabled but it doesn't seem to work
Let me see now, which is option 1 or 2?
2, thanks
I checked there anamation was starting constantly from the first frame and that was the problem. The solution to which turned out to be too ugly.
So I modernized the version with the angle and added animation there, I think this version is the most logical.
kibaga.org/c3-example/file_uploads/index.php
The others I delete they were not worthy.
Thank you, it works, now I will use it in my game!