Ok so i have a scoring mechanism for a scoreTest app and here’s the problem…
So i have this piece of code.
local box2 = display.newImageRect("box2.png", 30, 30 ) box2.x = display.contentCenterX box2.y = 350 local function updateHighScore(event) if event.phase == "began" then if score \> highScore then highScore = highScore + 0 highScoreTxt.text = string.format("highScore: %d", score) elseif highScore \> score then print("test") end end end box2:addEventListener("touch", updateHighScore)
So when score is greater than highScore and i press the box then the highScore changes to the score
now when highScore is greater than score then its supposed to print “test” but nothing happens… what am i doing wrong?
– I Use SubLime Text Editor