Hello all,
I am trying to get my game to stop when a certain amount of objects are caught but It doesn’t seem to be working. Here is the basics of my code…
local n = 0 -- the variable
n = n + 1 --when you catch an apple
if lives == 1 then --The lives are working fine and the game ends when I run out of lives
noMoreApples()
pauseBtn.isVisible = false
pig.isVisible = false
elseif n == 4 then --But with the same logic it doesn't work
noMoreApples()
pauseBtn.isVisible = false
pig.isVisible = false
I have a command to zero out the “n” variable which is just “n = 0” in the end game logic and it works because I have it printing to the terminal and it restarts every time. The apples won’t stop falling when it reaches 4 apples.
Danny [import]uid: 59140 topic_id: 30512 reply_id: 330512[/import]
