How to increase speed ?

I am making a small game for myself, which includes a bouncing ball.

I am using physics engine ecause it makes everything more realistic, and I set gravity to 0,0.

Then when I start the game, I do this :

[lua] ball:applyLinearImpulse(1,1, ball.x, ball.y)[/lua]

Which makes the ball move.

But what I would like to do, is f.ex every 20 seconds, or if the ball hits a certain object, I would like to increase the speed of the ball.

I have tried apply tourque and force and angular force, but it never works as expected. All I want to do is increase the speed, without changing the angle of the movement.

I know I could draw the ball and move it myself, but I would never (IMHO) get the realistic effects of bouncing without writing a lot of code. [import]uid: 61610 topic_id: 11079 reply_id: 311079[/import]

Anyone know how to set the speed to 0, so the ball stops ? [import]uid: 61610 topic_id: 11079 reply_id: 40285[/import]

[lua]ball:setLinearVelocity(0,0) --will stop the ball
[/lua]
To increase speed of the ball do this…
WARNING : Untested code
[lua]function increaseSpeed(ball, multiplier) – increase the speed of ball by factor of multiplier

local vx, vy = ball:getLinearVelocity()

ball:setLinearVelocity(vx*multiplier, vy*multiplier)

end

–call increaseSpeed(ball, multiplier) whenever you want… :)[/lua] [import]uid: 48521 topic_id: 11079 reply_id: 40463[/import]

Thanks. This is exactly what I needed [import]uid: 61610 topic_id: 11079 reply_id: 40531[/import]