Do you know what’s wrong with this code?
[code]require( “ice” )
local scores = ice:loadBox( “scores” )
local onballTap = function( event )
scores:increment( “ball”, 1 )
scores:save()
end
local onEnterFrame = function( event )
ball.score.text = scores:retrieve( “ball” ) or 0
end
Runtime:addEventListener( “enterFrame”, onEnterFrame )
ball = display.newImageRect( “SkySoccer Ball.gif”, 100, 100 )
ball.x = display.contentCenterX
ball.y = 429
ball.myName = “ball”
ball.score = display.newText( “0”, 0, 0, native.systemFont, 20 )
ball.score.x = 305
ball.score.y = 15
ball:addEventListener( “tap”, onballTap )
screenGroup:insert( ball )[/code] [import]uid: 203192 topic_id: 34553 reply_id: 334553[/import]
