i am pretty new to c++ and dark gdk. im trying to make a simple platform game to start off. i have the basic controls down, the animations, and collision. but i am having much trouble finding how to create the effects of gravity. please help.
uhmyeah
0
Newbie Poster
Recommended Answers
Jump to PostWhat exactly do you mean?
If you have an object moving, and you want gravity to account for its movement, then
you can just do this :const float GRAVITY = -9.8; ball.x += ball.velocity.x * dt; ball.y += ball.velocity.y + GRAVITY * dt;
Those follow …
All 4 Replies
mrnutty
761
Senior Poster
nbaztec
45
Posting Pro in Training
uhmyeah
0
Newbie Poster
nbaztec
45
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.