Top down physics?

I’m working on a gaming using physics. The view is top down. I’d like to have some friction as objects move through space. Imagine looking at car from above and using physics to move it. As it the car rolled across the screen it would slow down. I need some friction that applies all the time. [import]uid: 98652 topic_id: 20343 reply_id: 320343[/import]

You can still have friction with objects and have gravity set to 0. You may have to increase the friction some since gravity in theory figures into it.

In theory. [import]uid: 19626 topic_id: 20343 reply_id: 79482[/import]

Well I answered my own question. Of course if anyone as a better solution let me know.

Here’s what I did:

[lua]local function on_frame( event )
local vx, vy = ball:getLinearVelocity()
ball:setLinearVelocity( vx * floor_friction, vy * floor_friction )
end

Runtime:addEventListener( “enterFrame”, on_frame )[/lua] [import]uid: 98652 topic_id: 20343 reply_id: 79483[/import]

Not sure what you’re suggesting. I get the theory. But in box2d terms friction assigned to an object only applies when the object hits another object. At least that’s what I observed in my test. [import]uid: 98652 topic_id: 20343 reply_id: 79485[/import]

Here’s an even better answer: body.linearDamping = 1 [import]uid: 98652 topic_id: 20343 reply_id: 79498[/import]