Compare Nil to Number error

In my callGameOver = function, when I click on the menu, restart or next button I get anattempt to compare nil to number in the createLevel = function
at

1
2
3
                      if claw.x < 116 then
                         claw.x = 116
                      end

Try adding a nil check to your logic statement:

if claw.x ~= nil and claw.x < 116 then
claw.x = 116
end

views:2512 update:2011/10/15 21:01:16
corona forums © 2003-2011