I’m still getting the same error message. This time: "lua:50: ‘}’ expected (to close ‘{’ at line 49) near ‘=’
Maybe I’ll just post the whole code of the main menu:
[lua] --Require the “Widget” library (were using the slider)
local widget = require(“widget”)
–Require the physics library
local physics = require(“physics”)
–Require the UI Library
local ui = require(“ui”)
–Hide the device’s status bar
display.setStatusBar(display.HiddenStatusBar)
local displayGroup = display.newGroup()
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
local btnAnim
local btnSound = audio.loadSound(“btnSound.wav”)
function scene:createScene(event)
local displayGroup = self.view
storyboard.removeScene(“loadmainmenu”)
storyboard.removeScene(“levelselector”)
storyboard.removeScene(“arcade”)
storyboard.removeScene(“options”)
print( “\nmainmenu: createScene event” )
end
function scene:enterScene(event)
local displayGroup = self.view
print(“mainmenu: enterScene event”)
local backgroundImage = display.newImageRect(“mainmenu.png”, 480, 320)
backgroundImage.x = 240; backgroundImage.y = 160
displayGroup:insert(backgroundImage)
local storyBtn
local onPlayTouch = function(event)
if event.phase == “release” then
storyboard.gotoScene(“levelselector”, “fade”, 300)
end
end
storyBtn = widget.newButton{
default.Src = “storybtn.png”,
defaultX = 100,
defaultY = 100,
overSrc = “storybtn-over.png”,
overX = 100,
overY = 100,
onEvent = onPlayTouch,
id = “StoryButton”,
text = “”,
font = “Helvetica”,
textColor = {255, 255, 255, 255},
size = 16
}
storyBtn.x = 240; storyBtn.y = 440
displayGroup:insert(storyBtn)
btnAnim = transition.to(storyBtn, {time=500, y=260, transition=easing.inOutExpo})
local optBtn
local onOptionsTouch = function(event)
if event.phase == “release” then
audio.play(btnSound)
storyboard.gotoScene(“options”, “crossfade”, 300)
end
end
local optBtn
optBtn = widget.newButton{
defaultSrc = “optbtn.png”,
defaultX = 60,
defaultY = 60,
overSrc = “optbtn-over.png”,
overX = 60,
overY = 60,
onEvent = onOptionsTouch,
id = “OptionsButton”,
text = “”,
font = “Helvetica”,
textColor = {255, 255, 255, 255},
size = 16,
emboss = false
}
optBtn.x = 430; optBtn.y = 440
displayGroup:insert(optBtn)
btnAnim = transition.to(optBtn, {time=500, y=280, transition=easing.inOutExpo})
local arcadeBtn
local arcadeBtn
local onOptionsTouch = function(event)
if event.phase == “release” then
audio.play(btnSound)
storyboard.gotoScene(“arcade”, “crossfade”, 300)
end
end
arcadeBtn = widget.newButton{
default.Src = “arcadebtn.png”,
defaultX = 100,
defaultY = 100,
overSrc = “arcadebtn-over.png”,
overX = 100,
overY = 100,
onEvent = onPlayTouch,
id = “ArcadeButton”,
text = “”,
font = “Helvetica”,
textColor = {255, 255, 255, 255},
size = 16,
emboss = false
}
arcadeBtn.x = 240; arcadeBtn.y = 440
displayGroup:insert(arcadeBtn)
btnAnim = transition.to(arcadeBtn, {time=500, y=260, transition=easing.inOutExpo})
local brutalBtn
local brutalBtn
local onOptionsTouch = function(event)
if event.phase == “release” then
audio.play(btnSound)
storyboard.gotoScene(“brutal”, “crossfade”, 300)
end
end
brutalBtn = widget.newButton{
default.Src = “brutalBtn.png”,
defaultX = 100,
defaultY = 100,
overSrc = “brutalBtn-over.png”,
overX = 100,
overY = 100,
onEvent = onPlayTouch,
id = “BrutalButton”,
text = “”,
font = “Helvetica”,
textColor = {255, 255, 255, 255},
size = 16,
emboss = false
}
brutalBtn.x = 240; brutalBtn.y = 440
displayGroup:insert(brutalBtn)
btnAnim = transition.to(brutalBtn, {time=500, y=260, transition=easing.inOutExpo})
end
function scene:exitScene()
if btnAnim then transition.cancel(btnAnim); end
print(“mainmenu: exitScene event”)
end
function scene:destroyScene(event)
print("((destorying mainmenu’s view))")
end
scene:addEventListener( “createScene”, scene )
scene:addEventListener( “enterScene”, scene )
scene:addEventListener( “exitScene”, scene )
scene:addEventListener( “destroyScene”, scene )
return scene
[lua]I can’t see what I’m doing wrong here
[import]uid: 69494 topic_id: 30099 reply_id: 120886[/import]