yeah thanks, i got it working i think its because of the placement of the code so at first it was like this
local tapCount = 0
local physics = require( "physics" )
physics.start()
physics.addBody( platform, "static" )
physics.addBody( balloon, "dynamic", { radius=50, bounce=0.3 } )
local bg = display.newImageRect("background.png", 360, 580)
bg.x = display.contentCenterX
bg.y = display.contentCenterY
local textScore = display.newText( tapCount, display.contentCenterX, 20, native.systemFont, 40)
textScore:setFillColor(0, 0, 0)
local platform = display.newImageRect("platform.png", 300, 50)
platform.x = display.contentCenterX
platform.y = display.contentHeight-25
local balloon = display.newImageRect("balloon.png", 112, 120)
balloon.x = display.contentCenterX
balloon.y = display.contentCenterY
balloon.alpha = 0.85
local function pushBalloon()
balloon:applyLinearImpulse(0, -0.80, balloon.x, balloon.y)
tapCount = tapCount + 1
textScore.text = tapCount
end
balloon:addEventListener( "tap", pushBalloon)
then after i did some modification it looks like this
local tapCount = 0
local bg = display.newImageRect("background.png", 360, 580)
bg.x = display.contentCenterX
bg.y = display.contentCenterY
local textScore = display.newText( tapCount, display.contentCenterX, 20, native.systemFont, 40)
textScore:setFillColor(0, 0, 0)
local platform = display.newImageRect("platform.png", 300, 50)
platform.x = display.contentCenterX
platform.y = display.contentHeight-25
local balloon = display.newImageRect("balloon.png", 112, 120)
balloon.x = display.contentCenterX
balloon.y = display.contentCenterY
balloon.alpha = 0.85
local physics = require( "physics" )
physics.start()
physics.addBody( platform, "static" )
physics.addBody( balloon, "dynamic", { radius=50, bounce=0.3 } )
local function pushBalloon()
balloon:applyLinearImpulse(0, -0.80, balloon.x, balloon.y)
tapCount = tapCount + 1
textScore.text = tapCount
end
balloon:addEventListener( "tap", pushBalloon)
i didnât really think that solar would care about the order of the code, i was wrong
again thanks for the help!.