I am experimenting some stuff. I have a circle body, and walls around the screen. Circle is dynamic and walls are static bodies. I drag the circle with mouse and when i release it keeps moving - on purpose. Then it bounces the wall. Everything is ok up to here.
But if I drag the circle up to the walls with fast speed I can get it pass the walls. On low speeds collision occurs and it does not pass the wall but if I drag it fast enough, it just pass through…
I tried isBullet = true, but it doesn’t help.
Any help appreciated…
Rick
[code]
local physics = require(“physics”)
local rand = math.random
physics.start()
physics.setGravity(0,0)
system.activate(“multitouch”)
display.setStatusBar(display.HiddenStatusBar)
local content = display.newGroup ( )
local ceiling = display.newRect( content, 0, 0, 320, 1 )
physics.addBody ( ceiling, “static”, {density=1, friction=0.2, bounce=0.2} )
local floor = display.newRect( content, 0, 479, 320, 1 )
physics.addBody ( floor, “static”, {density=1, friction=0.2, bounce=0.2} )
local leftWall = display.newRect( content, 0, 1, 1, 478 )
physics.addBody ( leftWall, “static”, {density=1, friction=0.2, bounce=0.2} )
local rightWall = display.newRect( content, 319, 1, 100, 478 )
physics.addBody ( rightWall, “static”, {density=1, friction=0.2, bounce=0.2} )
local coin = display.newCircle( 160, 60, 20 )
coin:setFillColor(255, 0, 0)
physics.addBody ( coin, “dynamic”, {density=0.6, friction=0.2, bounce=0.2 ,radius=20} )
coin.isBullet = true
local onTouch = function (event)
local target = event.target
if(event.phase == “began”) then
target:setLinearVelocity(0,0)
target.x0 = event.x
target.y0 = event.y
display.getCurrentStage ( ):setFocus(target)
elseif (event.phase == “moved”) then
target.dx = event.x - target.x0
target.dy = event.y - target.y0
target.x = target.x + target.dx
target.y = target.y + target.dy
target.x0 = event.x
target.y0 = event.y
else
target.linearDamping = 1
–target:applyLinearImpulse(rand(-10,10),rand(-10,10),target.x, target.y)
target:setLinearVelocity( target.dx * 30, target.dy * 30)
print(target.dx)
print(target.x0)
display.getCurrentStage ( ):setFocus(nil)
end
end
coin:addEventListener ( “touch”, onTouch )
[/code] [import]uid: 46529 topic_id: 13831 reply_id: 313831[/import]

[import]uid: 52491 topic_id: 13831 reply_id: 51088[/import]