Every time I tap on the ball in my game, the score count goes up by one. But, if I follow the ball with my mouse, or what would be the finger if it were a real game, the score jumps numbers and sometimes skips them. For example, it can go from 0-9 in a second. Any way to make it so it only recognizes one tap? Here’s my basic code –
function moveBall(event)
local vx = (ball.x-event.x)/15
local vy=-5.0
ball:applyLinearImpulse( vx, vy, event.x, event.y )
score = score + 1
scoreText.text = score
if (score > highscore) then
highscore = score
highscorescore.text = highscore
end
end
ball:addEventListener(“touch”, moveBall) [import]uid: 39628 topic_id: 7760 reply_id: 307760[/import]