I have just started and have created a simple game to randomly display balloons on the screen using the physics engine. The balloons move from up screen and keeps moving till disappearance. The user will be able to click on a balloon to bomb it. i have used the following function in the Even listener to call the display ballon function:-
function DisplayBalloon(event)
local indexFileNumber = objectX(1,11)
local balloonObject = display.newImage( “balloon1.png” )
balloonObject.x = objectX(-50, 320)+5
physics.addBody(balloonObject, {density=0.0, bounce = 0.0, radius=30, friction=0.0 })
balloonObject:addEventListener( “touch”, moveBalloon )
end
function startBalloons ( event )
DisplayBalloon()
–timer.performWithDelay(150, DisplayBalloon,1)
end
Runtime:addEventListener( “enterFrame”, startBalloons)
The have used the “EnterFrame” even to call the balloon function using the global Runtime object. The problem is that when i used that function it calls the function every millisecond so its crowded the screen area in less than 10 seconds. How can i change the above code to call that function lets say every 1 second.
Another question please, for memory management, i read that for better performance using group will help in memory management and i have no idea how to use that and what is the benefit of the group concept. and how can apply it in my app.
Thanks
[import]uid: 11038 topic_id: 3448 reply_id: 303448[/import]