--[[
This all coded by BlixerTheGamer (i edited it a bit this is superk1008 talkin)
For the Mayro Mod i'm working it
]]
enable=true C=false MP='../My-Mod/music/' GOM=MP..'gameOver'
function onCreate() PS=version<'0.7' and 'PlayState' or 'states.PlayState' precacheSound('Break') precacheSound('MDL') precacheSound(GOM) precacheSound(GOM..'End')
 makeLuaSprite('GO','MGO') setGraphicSize('GO',1280,720) setProperty('GO.antialiasing',0) objCam('GO','other') 
 setProperty('GO.y',-750)
end

function onGameOver() if not practice and enable then setProperty('paused',true) openCustomSubstate('MGO',true) return Function_Stop end end
function onCustomSubstateCreate(n) if n=='MGO' then addDie(1) playSound('Break',1,'boom') addLuaSprite('GO') doTweenY('Boo','GO',0,1,'bounceOut') end end
function onTweenCompleted(t) if t=='Boo' then C=true playSound('MDL',1,'yes') playSound(GOM,.7,'GM') end end
function onSoundFinished(t) if t=='GM' then playSound(GOM,.7,'GM') end end
function onCustomSubstateUpdatePost(n,e)
 if n=='MGO' then
 if keyJustPressed('accept') and C then C=false stopSound('GM') stopSound('yes') playSound(GOM..'End',.7,'GME') runTimer('F',.7) end
 if keyJustPressed('back') and C then C=false stopSound('GM') stopSound('yes') exitSong() end
 end
end
function onTimerCompleted(t) if t=='F' then cameraFade('other','000000',2) runTimer('Ret',2.7) end if t=='Ret' then restartSong() end end
function setDie(T) setPropertyFromClass(PS,'deathCounter',T) end function getDie() return getPropertyFromClass(PS,'deathCounter') end function addDie(T) setDie(getDie()+T) end
function objCam(t,c) if version=='1.0' then setProperty(t..'.camera',instanceArg(c),false,true) else setObjectCamera(t,c) end end