Asteroids Bullets Directions?
Blitz3D Forums/Blitz3D Beginners Area/Asteroids Bullets Directions?
| ||
hiya all, I am wondering how do you do Bullets directions when the spaceship move around all angle and fire at the same time. I was thinking of using rotateimage for spaceship and bullets but no it doesnt work. does anyone could up with simple solutions? cheers |
| ||
it is 2D game by the way |
| ||
You could 'prerotate' the images: copy the original ship's image 36 times, and rotate them with steps of 10. For the projectiles, you could use cos and sin to calculate it's position: x# = x# + (cos(angle#) * speed#) y# = y# + (sin(angle#) * speed#) DrawImage bullet, x#, y# DrawImage ship, ship_x, ship_y, angle# / 10 |
| ||
Thanks B32 =) cheers |