Hi,
I have a problem that I can’t find a way to solve.
_G.currentLevel is 1 when the method is first invoked. It will be 2 after the player passes the level.
My problem is, this works on simulator but the require “x” part does not on my test device, iPad 3. Any ideas?
[lua]function getData()
local levelData = {}
levelData.background = “images/levels/level1/background.jpg”
levelData.music = “sounds/1-4-house.ogg”
levelData.noOfObjectsToFind = 4
levelData.timeRequired = “04:00” --IN MINUTES
levelData.coinReward = 20
levelData.objects =
{
grasshopper =
{
src = “images/levels/level1/grasshopper.jpg”,
imageWidth = 43,
imageHeight = 33,
x = 170,
y = 83,
},
guitarPick =
{
src = “images/levels/level1/guitarpick.jpg”,
imageWidth = 28,
imageHeight = 26,
x = 311,
y = 55,
},
tie =
{
src = “images/levels/level1/tie.jpg”,
imageWidth = 36,
imageHeight = 136,
x = 430,
y = 66,
},
dice =
{
src = “images/levels/level1/dice.jpg”,
imageWidth = 36,
imageHeight = 35,
x = 350,
y = 66,
},
}
return levelData
end[/lua]
[lua]–THIS WORKS
local commonSetup = require(“levels.setup.commonSetup”)
local commonData = commonSetup.getCommonData()
–BUT THIS DOES NOT WORK
local levelSetup = require(“levels.setup.level” … _G.currentLevel … “setup”)
local levelData = levelSetup.getData()[/lua]
_G.currentLevel is 1 when the method is first invoked. It will be 2 after the player passes the level.
My problem is, this works on simulator but the require “x” part does not on my test device, iPad 3. Any ideas? [import]uid: 154911 topic_id: 34789 reply_id: 334789[/import]
[import]uid: 134049 topic_id: 34789 reply_id: 138283[/import]