Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Projectile Motion

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 dribble04   Members   

159
Like
0Likes
Like

Posted 23 August 2013 - 12:10 AM

Hey,

 

Can somebody please tell me how I can simulate a trajectory or projectile motion. I am building a game where a character is moving and as it gains momentum and moves up a slope, I want the character to launch it self.

 

Any help would be greatly appreciated.

 

Thank you.

 

Cheers!!



#2 Álvaro   Members   

21104
Like
2Likes
Like

Posted 24 August 2013 - 02:56 AM

Look up `Euler integration'. You model your character/projectile/whatever as a point mass. In each frame, compute the sum of all the forces, compute acceleration (a vector) as force divided by mass, and then do this:
  velocity += acceleration * delta_time;
  position += velocity * delta_time;
If you want to do the same thing for rotations, the situation is similar, but make sure you understand this part first.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.