I’m a Corona beginner and have been using the Ghosts vs Monsters game as an example/template to learn and build my own game.
in the mainmenu.lua file at the beginning of the “new” function it states:
__________________________________________
function new()
local menuGroup = display.newGroup()
local ui = ui --require(“ui”)
local ghostTween
local ofTween
local playTween
local isLevelSelection = false
…
___________________________________________
In my code that is based off of this, I get an error in the console: “attempt to index upvalue ‘ui’ a (nil value)”
If I change the “local ui=ui” line to "local ui = require(“ui”) everything works fine.
How does the Ghosts vs Monsters code work without having to use the require(“ui”) line?
Thanks,
Chris [import]uid: 146966 topic_id: 27346 reply_id: 327346[/import]
[import]uid: 52491 topic_id: 27346 reply_id: 111141[/import]