Easing Velocity

I am trying to create a ramp effect when the gravity is (0,0). I am trying this:

[lua]vx, vy = event.other:getLinearVelocity()
transition.to( event.other, { time=1000, event.other:setLinearVelocity( vx, vy-150 ), transition=easing.linear})[/lua]
I want to ease the velocity change. Can this be done? Or is there a better way? [import]uid: 24305 topic_id: 5892 reply_id: 305892[/import]

Nevermind, I figured this out. Duh!! Just setGravity offset on phase “begin” and reset it back to (0,0) on phase “ended” to similate a ramp.

Thx [import]uid: 24305 topic_id: 5892 reply_id: 20211[/import]

Wow wow wow. Hold on. Can you show some code? This is cool. I have implemented a drag equation if you are interested. [import]uid: 8192 topic_id: 5892 reply_id: 20241[/import]

I’ll post the complete code tommorrow if you still need it (it’s not with me now) but basically…

  • You create a sensor similar to the pockets in “Simple Pool” with an event handler.
  • On collision the event handler is called and during phase “begin” if the ramp is uphill… then you setGravity(0,-10)
  • Then, on collision phase “ended” you set it back to setGravity(0,0)

Hope this helps
[import]uid: 24305 topic_id: 5892 reply_id: 20258[/import]

Cool!!! [import]uid: 8192 topic_id: 5892 reply_id: 20324[/import]