Hi guys,
I’ve been trying to figure out what the error for nearly two days but I can’t do so. I’m getting the error below:
‘end’ expected (to close ‘function’ at line 75) near ‘<eof>’
I can’t find any ‘ends’ missing, and furthermore my <function()>s are all closed with end.
I’m a complete noob so expect this question to be stupid 
Please help me solve this error!
Code:
– Description:
–
– Version: 1.0
– Managed with http://CoronaProjectManager.com
–
– Copyright 2015 . All Rights Reserved.
–
----- references
local repeat1
local repeat2
------preload audio
local bmusic = audio.loadSound(“Background.wav”)
local blast = audio.loadSound(“blast.mp3”)
local boing = audio.loadSound(“boing-1.wav”)
------ sprite sheet
local options =
{
width = 120 ,
height = 120,
numFrames = 36,
sheetContentWidth = 1080,
sheetContentHeight = 480
}
local sheet = graphics.newImageSheet(“SpriteSheet1stgame.png”,options)
local bg = display.newImage(sheet,25)
bg.x = display.contentCenterX
bg.y = display.contentCenterY
bg.xScale=10
bg.yScale=5
--------individual frame creation for game start
local frameSaveBlob = display.newImage(sheet,17 )
frameSaveBlob.x = display.contentCenterX-150
frameSaveBlob.y =180
frameSaveBlob.xScale=2
frameSaveBlob.yScale=2
local qg = display.newImage(sheet,23)
qg.x = display.contentCenterX + 100
qg.y = display.contentCenterY +90
qg:scale(1.28,1.28)
local playg = display.newImage(sheet,19)
playg.x = display.contentCenterX + 100
playg.y = display.contentCenterY - 90
playg:scale(1.28,1.28)
local insg = display.newImage(“UpdateIns.png”)
insg.x = display.contentCenterX + 100
insg.y = display.contentCenterY
insg:scale(0.32,0.32)
-------- game functions
function repeat1()
transition.cancel(frameSaveBlob.trans)
frameSaveBlob.trans = transition.to(frameSaveBlob, {time=2000, y=150,onComplete=repeat2})
end
function repeat2()
transition.cancel(frameSaveBlob.trans)
frameSaveBlob.trans = transition.to(frameSaveBlob, {time=2000, y=180, delay=50, onComplete=repeat1})
end
local function newgame(event)
local playg2 = display.newImage(sheet,20)
playg2.x = display.contentCenterX + 100
playg2.y = display.contentCenterY - 90
playg2:scale(1.5,1.5)
timer.performWithDelay ( 200,
function()
playg2:removeSelf()
end ,1 )
–timer.performWithDelay ( 200, function() display.remove(playg2) end,1 )
return true
end
local function instruction(event)
local ig2 = display.newImage(sheet,22)
ig2.x = display.contentCenterX + 100
ig2.y = display.contentCenterY
ig2:scale(1.5,1.5)
timer.performWithDelay ( 200, function() ig2:removeSelf() end ,1 )
–timer.performWithDelay ( 200, function() display.remove(playg2) end,1 )
return true
end
local function quit(event)
local qg2 = display.newImage(sheet,24)
qg2.x = display.contentCenterX + 100
qg2.y = display.contentCenterY +89
qg2:scale(1.5,1.5)
timer.performWithDelay ( 200, function() qg2:removeSelf() end ,1 )
–timer.performWithDelay ( 200, function() display.remove(playg2) end,1 )
return true
end
local function backgroundMusic()
local options = { loops=-1}
audio.play(bmusic, options)
end
----------start_of_game
repeat1()
backgroundMusic()
playg:addEventListener(“tap”,newgame)
insg:addEventListener(“tap”,instruction)
qg:addEventListener(“tap”,quit)
I was literally able to debug my large of chunks of code and modules with much more ease than I could’ve ever imagined! 