Haha. I need some serious help here. I failed big time.
There is a cube, and an object to catch it. When the cube hits the object that catches it, I want there to be more cubes.
Also, I’d like for the cube to go away. Help!
Here’s my code.
[lua]local function spawnCrate()
local crate = display.newImage( “cratesmall.png” )
physics.addBody( crate, { density = 1.0, friction = 0.3, bounce = 0.2 } )
crate.x = math.random(250)
crate.y = math.random(-40)
end
timer.performWithDelay( 1000, spawnCrate, 2 )
function chute:collision (event)
if event.other.myName == “crate” then
display.remove( crate )
timer.performWithDelay( 1000, spawnCrate, 1 )
end
end
[/code] [import]uid: 69700 topic_id: 11695 reply_id: 42529[/import]
Ok. Now I only want the top part of the object to work with the collision. Is there an advanced physics body tutorial? [import]uid: 25216 topic_id: 11695 reply_id: 42531[/import]
Ok. Now I only want the top part of the object to work with the collision. Is there an advanced physics body tutorial? [import]uid: 25216 topic_id: 11695 reply_id: 42532[/import]