i want to design a shooting game but my arrows only go in one direction, how do i fix that to where a arrow will travel in the direction that i’m facing
There are many ways of doing so.
Since you’re using the “Arcade Character Animation” extension, we can use that as a way to determine which direction the player is facing and apply it to its projectile:
There might be a better way of doing it but this is what I can think of for the moment.
By the way, I thought I'd warn that you have a bug with your overlap between the projectile and the enemy ...
You’re using “mySprite” as the variable to destroy. When using an overlap block, you almost always want to use the arguments aka the “sprite” and “othersprite” variables.
In this case, you want to use “othersprite” instead of “mySprite”. That way, the code works on all enemies not just the enemy called “mySprite”.
- Your code should go from this:
- To this:
For reference, here’s the game with the new edits.
Hope this helps Happy coding!
using the dart extension is also a great way to make projectiles
how do i use dark extension im having trouble
you might need to use sprite util to convert degrees into radians