I know this might be a stupid question. I have been programming for years, and can’t figure this out in LUA. I have my main.lua file that calls functions from other files to load graphics only. Please Help…
main.lua:file
local stages = require( "stages" )
local stage
local function stageSetup(currStage, nextStage)
if stage == 1 then
stage = stages.stage1
end
end
stageSetup
stages.lua:file
local function stage1()
local bg\_png = display.newImage("bg.png", 0, 0)
local groundbtm\_pn = display.newImage("groundBtm.png", 0, 280)
local groundtop\_pn = display.newImage("groundTop.png", 0, 262)
local rock1\_png = display.newImage("rock1.png", 203, 230)
local rock5\_png = display.newImage("rock5.png", 221, 252)
local tree1\_png = display.newImage("tree1.png", 235, 226)
end
error:
Copyright © 2009-2010 A n s c a , I n c .
Version: 1.0.0
Build: 2010.109
The file sandbox for this project is located at the following folder:
(/Users/derwydd/Library/Application Support/Corona Simulator/game-F84EB65064B72C57CD4A94449A9F2023)
Runtime error
…/Desktop/LuckiiClover/GameName/game/main.lua:15: attempt to index local ‘stages1’ (a boolean value)
stack traceback:
[C]: ?
…/Desktop/LuckiiClover/GameName/game/main.lua:15: in main chunk
Runtime error: …/Desktop/LuckiiClover/GameName/game/main.lua:15: attempt to index local ‘stages1’ (a boolean value)
stack traceback:
[C]: ?
…/Desktop/LuckiiClover/GameName/game/main.lua:15: in main chunk
[import]uid: 7197 topic_id: 3575 reply_id: 303575[/import]