how to apply gravity like force on individual objects?.

21 views
Skip to first unread message

Zain ul Abedeen

unread,
Jul 17, 2018, 2:36:44 AM7/17/18
to KivEnt

I have a gamesystem that applies multiple forces on various objects. The gamesystem update method looks like

gamesystem.update():
force = (0, -5000)
body.reset_forces()
body.apply_force(force)

the update_time = .1, for this method

I get the similar functionality as if cymunk_physics.gravity is on. but the only problem is if the object is dragged and thrown up hard the object will stick to the roof for some time depending upon how hard the throw is.

on chipmunk side my problem is somewhat like

after reading chipmunk forums I get the idea to update the velocity of an object. but I do not get gravity like feeling by doing so the object rather bounces in a loop as it hits the ground.

the other way can be is to skip some objects not to undergo cymunk_physics.gravity callback step. but how to access bodies in cymunk_physics.gravity is a question?

Thanks!!! 
Reply all
Reply to author
Forward
0 new messages