Bullets

Previous topic - Next topic

WAAAAAA

im making a 2d game with space ships ur on  the bottom enemies top standard stuff how do i make the bullets go on an angle sorta thing? would i have to use the angle commands im not that good with them could u help me?

Gloomberg

You can use the simple Geometry. If x is the bullets's x coordinate and y its y coordinate? a - its an angle, at which you want to turn your bullet, and speed is just a bullet speed:
Code (glbasic) Select
x=x+sin(a)*speed
y=y+cos(a)*speed
ROTOSPRITE bullet,x,y,a