Okay I do not get it, I understand they do not want us to use _G for globals, so I followed the tutorial and did this.
in a new Class called myData.lua
local M {}
local initialNumEnemiesOnStage = 5
return M
Then in my levelOne scene I called
local myData = require(“myData”)
( I get an error Attempt to compare number with nil )
if enemieCount < myData.initialNumEnemiesOnStage then
tmr = timer.performWithDelay(1000,addEnemy)
else
timer.performWithDelay (5000,removeEnemy)
timer.cancel(tmr)
end
end
Any Help is Appreciated.
JZ