SOLVED Breaking a bullet's velocity into components

Hi

So I was starting to implement shooting into my game (for now just calculating movement, and not factoring gravity at all), and I was rendering the bullets by drawing a quad at the given location. Each

update()

I would add the two stored components to the position of the bullet. Anyway, when I was trying out different angles, the bullet would only go at the nearest multiple of 45 degrees, which confused me because the input angles aren’t in multiples of that.

Bullet vectory component calculation:


velocityX = (float)(Math.cos(angle) * velocity);
velocityY = (float)(Math.sin(angle) * velocity);

Any thoughts or ideas would be helpful :slight_smile:

CopyableCougar4