Archived

This topic is now archived and is closed to further replies.

_Jedi_

shooting

Recommended Posts

Hello, Im trying to make my character shoot (2D mode view from the top, you know like those old tank games). I would like to understand how the all shooting works.. if anybody has a source code or a nice tutorial link or just any thoughts i would like to hear that Thanks [edited by - _Jedi_ on May 4, 2002 7:20:40 AM]

Share this post


Link to post
Share on other sites
how are u rotating the tank?

y == straight up into the air
DEG2RAD == convert degrees to radians
rot.y == rotation on the y axis 0->360 degrees of compass

dir.x = sin(rot.y*DEG2RAD);
dir.z = cos(rot.y*DEG2RAD);

now u know which way the tank is facing u can shoot a missile in that direction
vel == velocity
missile.vel = VECTOR(dir.x,0,dir.z)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites