Jump to content
  • Advertisement


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



This topic is 5917 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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)


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!