Jump to content
  • Advertisement

Archived

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

boolean010

Fire bullets from an object made out of lines

This topic is 6940 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 everyone, I''m trying to make a game where I have a spaceship that fires bullets in the direction that it''s pointing. I''ve tried using the following formulas listed below, from which I would find the slope in hopes of using it to direct the bullet to it''s target, but it doesn''t seem to work, instead of going in the intended direction, the bullets always go in a straight. Can anyone give me a hand, thank you. x = cos(ang); y = sin(ang);

Share this post


Link to post
Share on other sites
Advertisement
i had the same problem with my stuff, and the way i solved it was simple, although it may not work since its specific. If you''re talking about a polygon ship, then simply get the slope between the center of the polygon and the vertex where the bullet is shooting out of, and use that for the bullet.

Share this post


Link to post
Share on other sites
Thanks to everyone who took the time to reply my post. I think I should be able to implement the suggestion given by Zipster, thanks guys.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!