I have been playing around with Corona SDK and so far I have all my goals achieved but one seems beyond my reach at the moment.
I would like to simulate sand or pellets to fill a bucket. So far I have made this but it suffers greatly when 200 plus objects are created.
[lua]local someRand = math.random
local function createBB(e)
local bb = display.newCircle(10, h/2 + someRand(20), 2)
bb:setFillColor(someRand(255),someRand(255),someRand(255))
physics.addBody(bb, {density = 1.0, friction = 0.3, radius = 2})
bb.collision = onCollision
bb:addEventListener(“collision”, bb)
end
local spawn_timer = timer.performWithDelay(100, createBB, 500)
local function onCollision( event )
local otherObject = event.other
otherObject:removeSelf()
end
rect5:addEventListener( “collision”, onCollision )[/lua]
I am hoping there is a way to create a decent amount of sand particles to finish my idea.
Thanks,
Kevin
Phundroid [import]uid: 66342 topic_id: 13761 reply_id: 313761[/import]