Jump to content
  • Advertisement
Sign in to follow this  
YetAnotherSuperhero

Idiot (Me) can't figure out collisions

This topic is 3603 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

Hi, I'm new here. I have a collision problem I haven't been able to figure out. First off all, I'm using a open-source program called Construct, it's kind of like Game Maker. So it's not a language. My game is a top-down spaceship game, and I have the movement laid out: Each ship has these variables: Mass (is set at 300) MovSpeed = How much push the engines are giving XPos = X Position YPos = Y Position XMov = The movement from the engines along the X plane YMov = The movement from the engines along the Y plane XMovEx = The movement from external forces along the X plane YMovEx = The movement from external forces along the Y plane The ship moves by this: SET Ship.Value('XMov') to Ship.Value('XMov')+((Cos(Ship.Angle)*Ship.Value('MovSpeed')/Ship.Value('Mass'))*TimeDelta) SET Ship.Value('YMov') to Ship.Value('YMov')+((sin(Ship.Angle)*Ship.Value('MovSpeed')/Ship.Value('Mass'))*TimeDelta) then SET Ship.Value('XPos') to Ship.Value('XPos')+(Ship.Value('XMov')*TimeDelta)+(Ship.Value('XMovEx')*TimeDelta) SET Ship.Value('YPos') to Ship.Value('YPos')+(Ship.Value('YMov')*TimeDelta)+(Ship.Value('YMovEx')*TimeDelta) Now all this works fine. I just can't for the life of me fingure out how to make the ship bounce when it collides with an opposing ship. I hope I'm not rambling. Can anybody help me? If you can, please be easy on me. YetAnotherSuperhero

Share this post


Link to post
Share on other sites
Advertisement

http://en.wikipedia.org/wiki/Inelastic_collision

http://en.wikipedia.org/wiki/Elastic_collision

http://en.wikipedia.org/wiki/Coefficient_of_restitution

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!