How do i fix this projectiles?

help

can you share your code, and give a more detailed description on what’s going on? A few things I can get is that when the projectile heads right, the if statement inside the forever needs to switch direction. Use a (projectile[vx]) > 0 to allow the other direction. Another thing is that the while is useless and will lag your game.