Hi SegaBoy,
Just realised I copied the wrong class into that first post! Oops! This is the correct class that the error refers too;
{
module(…, package.seeall)
local localGroup = display.newGroup()
_W = display.contentWidth/2
_H = display.contentHeight/2
function new ()
local LSbackground = display.newImage(“Images/LSbackground.png”)
LSbackground.x = _W
LSbackground.y = _H
localGroup:insert(LSbackground)
local LSLogo = display.newImage(“Images/LSLogo.png”)
LSLogo.x = _W
LSLogo.y = 40
localGroup:insert(LSLogo)
function changeLevel (event)
if event.phase == “ended” then
director:changeScene(“game1”, “crossfade”)
director:levelChange(event.target.levels)
end
end
print ( levelsUnlocked[1] );
print ( levelsUnlocked[2] );
print ( levelsUnlocked[3] );
print ( levelsUnlocked[4] );
print ( levelsUnlocked[5] );
print ( levelsUnlocked[6] );
print ( levelsUnlocked[7] );
print ( levelsUnlocked[8] );
print ( levelsUnlocked[9] );
print ( levelsUnlocked[10] );
print ( levelsUnlocked[11] );
print ( levelsUnlocked[12] );
if (levelsUnlocked[1])
then
local levelOne = display.newImage(“Images/button1.png”)
levelOne.x = 15
levelOne.y = 60
levelOne.levels = 1
levelOne.xScale = 0.4
levelOne.yScale = 0.4
localGroup:insert(levelOne)
levelOne:addEventListener(“touch”, changeLevel)
end
if (levelsUnlocked[2])
then
local levelTwo = display.newImage(“Images/button2”)
levelTwo.x = 25
levelTwo.y = 60
levelTwo.levels = 2
levelTwo.xScale = 0.4
levelTwo.yScale = 0.4
localGroup:insert(levelTwo)
levelTwo:addEventListener(“touch”, changeLevel)
end
--------------------------------Level Three Button
if (levelsUnlocked[3])
then
local levelThree = display.newImage(“Images/button3”, 135, 60)
levelThree.levels = 3
levelThree.xScale = 0.4
levelThree.yScale = 0.4
levelThree:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelThree)
levelThree:addEventListener(“touch”, changeLevel );
end
–levelThree.scene = “level3”
--------------------------------Level Four Button
if (levelsUnlocked[4])
then
local levelFour = display.newImage(“Images/button4”, 195, 60)
levelFour.levels = 4
levelFour.xScale = 0.4
levelFour.yScale = 0.4
levelFour:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelFour)
levelFour:addEventListener(“touch”, changeLevel );
end
–levelFour.scene = “level4”
--------------------------------Level Five Button
if (levelsUnlocked[5])
then
local levelFive = display.newImage(“Images/button5”, 15, 120)
levelFive.levels = 5
levelFive.xScale = 0.4
levelFive.yScale = 0.4
levelFive:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelFive)
levelFive:addEventListener(“touch”, changeLevel );
end
–levelFive.scene = “level5”
--------------------------------Level Six Button
if (levelsUnlocked[6])
then
local levelSix = display.newImage(“Images/button6”, 75, 120)
levelSix.levels = 6
levelSix.xScale = 0.4
levelSix.yScale = 0.4
levelSix:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelSix)
levelSix:addEventListener(“touch”, changeLevel );
end
–levelSix.scene = “level6”
--------------------------------Level Seven Button
if (levelsUnlocked[7])
then
local levelSeven = display.newImage(“Images/button7”, 135, 120)
levelSeven.levels = 7
levelSeven.xScale = 0.4
levelSeven.yScale = 0.4
levelSeven:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelSeven)
levelSeven:addEventListener(“touch”, changeLevel );
end
–levelSeven.scene = “level7”
--------------------------------Level Eight Button
if (levelsUnlocked[8])
then
local levelEight = display.newImage(“Images/button8”, 195, 120)
levelEight.levels = 8
levelEight.xScale = 0.4
levelEight.yScale = 0.4
levelEight:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelEight)
levelEight:addEventListener(“touch”, changeLevel );
end
–levelEight.scene = “level8”
--------------------------------Level Nine Button
if (levelsUnlocked[9])
then
local levelNine = display.newImage(“Images/button9”, 15, 180)
levelNine.levels = 9
levelNine.xScale = 0.4
levelNine.yScale = 0.4
levelNine:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelNine)
levelNine:addEventListener(“touch”, changeLevel );
end
–levelEight.scene = “level8”
--------------------------------Level Ten Button
if (levelsUnlocked[10])
then
local levelTen = display.newImage(“Images/button10”, 75, 180)
levelTen.levels = 10
levelTen.xScale = 0.4
levelTen.yScale = 0.4
levelTen:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelTen)
levelTen:addEventListener(“touch”, changeLevel );
end
–levelEight.scene = “level8”
--------------------------------Level Eleven Button
if (levelsUnlocked[11])
then
local levelEleven = display.newImage(“Images/button11”, 135, 180)
levelEleven.levels = 8
levelEleven.xScale = 0.4
levelEleven.yScale = 0.4
levelEleven:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelEleven)
levelEleven:addEventListener(“touch”, changeLevel );
end
–levelEight.scene = “level8”
--------------------------------Level Twelve Button
if (levelsUnlocked[12])
then
local levelTwelve = display.newImage(“Images/button12”, 195, 180)
levelTwelve.levels = 8
levelTwelve.xScale = 0.4
levelTwelve.yScale = 0.4
levelTwelve:setReferencePoint(display.CentreReferncePoint);
localGroup:insert(levelTwelve)
levelTwelve:addEventListener(“touch”, changeLevel );
end
return localGroup
end
function clean()
print (‘Clean function called from scene with module(…, package.seeall) !’)
end
}
Sorry about the confusion, staring at this code trying to find a reason is starting to play with my mind haha
Ross [import]uid: 106143 topic_id: 28236 reply_id: 114075[/import]