I’ve created an Event Listener to spawn a ball when the screen is touched.
However, when ever I “touch” (click) the screen on the simulator, many balls are spawned. A new ball is spawned every time you move the mouse, and two times when you click. It’s honestly quite bizarre.
[lua]function spawnBall()
ball = display.newImage(“ball.png”)
ball.x = 180
ball.y = 80
physics.addBody( ball, { density=2.0, friction=0.5, bounce=0.3 } )
end
Runtime:addEventListener( “touch”, spawnBall )[/lua]
Thanks in advance. I’d really like to get this problem solved. [import]uid: 25216 topic_id: 14064 reply_id: 314064[/import]