Applying Impulse (Collision)

Hello,

I am trying to make a power up in my game. When the ball touches the star it applies a linear impulse which will jolt the ball. I am having some problems thought. The star is “static” when i apply the impulse it jolts back the way it came instead of going through the power up and per forming a jolt through the other side. Any help ? I also tried making a ( ball:isSensor = true) but it did not work.
local function onBounce ( self, event )

ball:applyLinearImpulse(0,-0.2, ball.x, ball.y)
end

star.collision = onBounce
star:addEventListener( “collision”, star)

Thank you. [import]uid: 23689 topic_id: 10859 reply_id: 310859[/import]

You are only applying a force in a single fixed direction. Check out the “body:applyLinearImpulse” API for details.
http://developer.anscamobile.com/reference/index/bodyapplylinearimpulse
I would also suggest looking at the “body:getLinearVelocity” API for a hint about how to get the directional data for an object.
http://developer.anscamobile.com/reference/index/bodygetlinearvelocity
[import]uid: 27965 topic_id: 10859 reply_id: 39514[/import]