local randomshit=require("randomshit")
local endscreen=require("endscreen")
local gurumeditation=require("gurumeditation")
local starscroller=require("starscroller")
local starfield=require("starfield")
local seagullalert=require("seagullalert")
local spectrumanalyzer=require("spectrumanalyzer")
local logo3dcycle=require("3dlogocycle")
local seagullflying=require("seagullflying")
local C64loading=require("C64loading")
local birddots=require("birddots")
local colordots=require("colordots")
local vortex=require("vortex")
local onebird=require("onebird")
local cubes=require("cubes")
local copperplasma=require("copperplasma")
local birdsprites=require("birdsprites")
local texturetunnel=require("texturetunnel")
local logicrunchlogo=require("logicrunchlogo")
local screenflash=require("screenflash")
local state={
renderCanvas=nil,
timePassed=0.0,
isReady=true,
startDelay=0.0,
timelineOffset=0.0,
guruActive=true,
starScrollerActive=false,
_starScrollerArmed=false,
starfieldActive=false,
_starfieldArmed=false,
_seagullFirstArmed=true,
_seagullSecondArmed=true,
_seagullThirdArmed=true,
_seagullFourthArmed=true,
spectrumActive=true,
logo3dActive=false,
_logo3dArmed=false,
seagullFlyingActive=false,
_seagullFlyingArmed=false,
C64loadingActive=false,
_C64loadingArmed=false,
birddotsActive=false,
_birddotsArmed=false,
colordotsActive=false,
_colordotsArmed=false,
vortexActive=false,
_vortexArmed=false,
cubesActive=false,
_cubesArmed=false,
onebirdActive=false,
_onebirdArmed=false,
copperplasmaActive=false,
_copperplasmaArmed=false,
birdspritesActive=false,
_birdspritesArmed=false,
endscreenActive=false,
_endscreenArmed=false,
texturetunnelActive=false,
_texturetunnelArmed=false,
logicrunchlogoActive=false,
_logicrunchlogoArmed=false,
_nextFlashIndex=1,
_quitArmed=true,
mainFont=nil,
counterFont=nil,
music=nil,
}
local function withVirtualSize(fn)
local origW,origH=love.graphics.getWidth,love.graphics.getHeight
love.graphics.getWidth=function()return 1920 end
love.graphics.getHeight=function()return 1080 end
fn()
love.graphics.getWidth=origW
love.graphics.getHeight=origH end
function love.load()
love.window.setMode(1920,1080,{fullscreen=true,fullscreentype="exclusive",vsync=true,highdpi=false,resizable=false,msaa=0})
love.window.setTitle("Phogelbice by Logicrunch")
love.graphics.setBackgroundColor(0,0,0)
love.graphics.setLineStyle("rough")
love.graphics.setDefaultFilter("nearest","nearest")
love.mouse.setVisible(false)
state.renderCanvas=love.graphics.newCanvas(1920,1080)
state.renderCanvas:setFilter("nearest","nearest")
state.mainFont=love.graphics.newFont(36)
state.counterFont=love.graphics.newFont(18)
love.graphics.setFont(state.mainFont)
if randomshit.load then randomshit.load() end
if gurumeditation.load then gurumeditation.load() end
if starscroller.load then starscroller.load() end
if starfield.load then starfield.load(nil,1920,1080) end
if seagullalert.load then seagullalert.load() end
if spectrumanalyzer.load then spectrumanalyzer.load() end
if logo3dcycle.load then logo3dcycle.load() end
if seagullflying.load then seagullflying.load() end
if endscreen.load then endscreen.load() end
if birddots.load then birddots.load() end
if colordots.load then colordots.load() end
if vortex.load then vortex.load() end
if cubes.load then cubes.load() end
if onebird.load then onebird.load() end
if copperplasma.load then copperplasma.load() end
if birdsprites.load then birdsprites.load() end
if C64loading.load then C64loading.load() end
if texturetunnel.load then texturetunnel.load() end
if logicrunchlogo.load then logicrunchlogo.load() end
if screenflash.load then screenflash.load() end
state.music=love.audio.newSource("hyperunknown_phogelbice.mp3","stream")
state.music:setLooping(false)
state.music:play()
state._starScrollerArmed=true
state._starfieldArmed=true
state._seagullFirstArmed=true
state._seagullSecondArmed=true
state._seagullThirdArmed=true
state._seagullFourthArmed=true
state._logo3dArmed=true
state._seagullFlyingArmed=true
state._endscreenArmed=true
state._C64loadingArmed=true
state._birddotsArmed=true
state._colordotsArmed=true
state._vortexArmed=true
state._cubesArmed=true
state._onebirdArmed=true
state._copperplasmaArmed=true
state._birdspritesArmed=true
state._texturetunnelArmed=true
state._logicrunchlogoArmed=true
state._nextFlashIndex=1
state._quitArmed=true end
function love.update(dt)
withVirtualSize(function()
if state.music and state.music:isPlaying() then
local t=state.music:tell("seconds") or 0
state.timePassed=math.max(0,t+0.0)
else
state.timePassed=0.0 end
if state._starScrollerArmed and state.timePassed>=7.680 then
state.starScrollerActive=true
state._starScrollerArmed=false end
if state.starScrollerActive and state.timePassed>=65.280 then
state.starScrollerActive=false end
if state._starfieldArmed and state.timePassed>=65.280 then
state.starfieldActive=true
state._starfieldArmed=false end
if state.starfieldActive and state.timePassed>=84.480 then
state.starfieldActive=false end
if state._seagullFirstArmed and state.timePassed>=3.123 then
if seagullalert.fire then seagullalert.fire(state.timePassed) end
state._seagullFirstArmed=false end
if state._seagullSecondArmed and state.timePassed>=10.801 then
if seagullalert.fire then seagullalert.fire(state.timePassed) end
state._seagullSecondArmed=false end
if state._seagullThirdArmed and state.timePassed>=18.476 then
if seagullalert.fire then seagullalert.fire(state.timePassed) end
state._seagullThirdArmed=false end
if state._seagullFourthArmed and state.timePassed>=145.210 then
if seagullalert.fire then seagullalert.fire(state.timePassed) end
state._seagullFourthArmed=false end
if state._logo3dArmed and state.timePassed>=19.200 then
state.logo3dActive=true
state._logo3dArmed=false end
if state.logo3dActive and state.timePassed>=34.560 then
state.logo3dActive=false end
if state._seagullFlyingArmed and state.timePassed>=34.560 then
state.seagullFlyingActive=true
state._seagullFlyingArmed=false
if seagullflying.start then seagullflying.start(state.timePassed) end end
if state.seagullFlyingActive and state.timePassed>=49.920 then
state.seagullFlyingActive=false end
if state._endscreenArmed and state.timePassed>=145.920 then
state.endscreenActive=true
state._endscreenArmed=false
if endscreen.start then endscreen.start(state.timePassed) end end
if state.endscreenActive and state.timePassed>=149.740 then
state.endscreenActive=false end
if state._birddotsArmed and state.timePassed>=99.841 then
state.birddotsActive=true
state._birddotsArmed=false
if birddots.start then birddots.start(state.timePassed) end end
if state.birddotsActive and state.timePassed>=115.193 then
state.birddotsActive=false end
if state._colordotsArmed and state.timePassed>=99.841 then
state.colordotsActive=true
state._colordotsArmed=false
if colordots.start then colordots.start(state.timePassed) end end
if state.colordotsActive and state.timePassed>=130.558 then
state.colordotsActive=false end
if state._vortexArmed and state.timePassed>=115.193 then
state.vortexActive=true
state._vortexArmed=false
if vortex.start then vortex.start(state.timePassed) end end
if state.vortexActive and state.timePassed>=130.558 then
state.vortexActive=false end
if state._cubesArmed and state.timePassed>=65.280 then
state.cubesActive=true
state._cubesArmed=false
if cubes.start then cubes.start(state.timePassed) end end
if state.cubesActive and state.timePassed>=83.220 then
state.cubesActive=false end
if state._onebirdArmed and state.timePassed>=97.980 then
state.onebirdActive=true
state._onebirdArmed=false
if onebird.start then onebird.start(state.timePassed) end end
if state.onebirdActive and state.timePassed>=99.841 then
state.onebirdActive=false end
if state._copperplasmaArmed and state.timePassed>=130.558 then
state.copperplasmaActive=true
state._copperplasmaArmed=false
if copperplasma.start then copperplasma.start(state.timePassed) end end
if state.copperplasmaActive and state.timePassed>=145.920 then
state.copperplasmaActive=false end
if state._birdspritesArmed and state.timePassed>=130.558 then
state.birdspritesActive=true
state._birdspritesArmed=false
if birdsprites.start then birdsprites.start(state.timePassed) end end
if state.birdspritesActive and state.timePassed>=145.920 then
state.birdspritesActive=false end
if state._C64loadingArmed and state.timePassed>=149.780 then
state.C64loadingActive=true
state._C64loadingArmed=false
if C64loading.start then C64loading.start(state.timePassed) end end
if state.C64loadingActive and state.timePassed>=152.680 then
state.C64loadingActive=false end
if state._texturetunnelArmed and state.timePassed>=84.480 then
state.texturetunnelActive=true
state._texturetunnelArmed=false
if texturetunnel.start then texturetunnel.start(state.timePassed) end end
if state.texturetunnelActive and state.timePassed>=99.841 then
state.texturetunnelActive=false end
if state._logicrunchlogoArmed and state.timePassed>=49.910 then
state.logicrunchlogoActive=true
state._logicrunchlogoArmed=false
if logicrunchlogo.start then logicrunchlogo.start(state.timePassed) end end
if state.logicrunchlogoActive and state.timePassed>=65.280 then
state.logicrunchlogoActive=false end
while state._nextFlashIndex<=9 do
local n=state._nextFlashIndex
local thr=(n==1 and 19.200) or
(n==2 and 34.557) or
(n==3 and 49.920) or
(n==4 and 65.280) or
(n==5 and 84.480) or
(n==6 and 99.841) or
(n==7 and 115.193) or
(n==8 and 130.558) or
(n==9 and 145.920) or nil
if not thr or state.timePassed<thr then break end
if screenflash.fire then screenflash.fire(state.timePassed) end
state._nextFlashIndex=state._nextFlashIndex+1 end
if state.spectrumActive and state.timePassed>=145.920 then
state.spectrumActive=false end
if randomshit.update then randomshit.update(dt,state.timePassed) end
if state.guruActive and gurumeditation.update then gurumeditation.update(dt,state.timePassed) end
if state.starScrollerActive and starscroller.update then starscroller.update(dt) end
if state.starfieldActive and starfield.update then starfield.update(dt) end
if state.spectrumActive and spectrumanalyzer.update then spectrumanalyzer.update(dt,state.timePassed) end
if state.logo3dActive and logo3dcycle.update then logo3dcycle.update(dt,state.timePassed) end
if state.seagullFlyingActive and seagullflying.update then seagullflying.update(dt,state.timePassed) end
if state.endscreenActive and endscreen.update then endscreen.update(dt,state.timePassed) end
if state.birddotsActive and birddots.update then birddots.update(dt,state.timePassed) end
if state.colordotsActive and colordots.update then colordots.update(dt,state.timePassed) end
if state.vortexActive and vortex.update then vortex.update(dt,state.timePassed) end
if state.cubesActive and cubes.update then cubes.update(dt,state.timePassed) end
if state.onebirdActive and onebird.update then onebird.update(dt,state.timePassed) end
if state.copperplasmaActive and copperplasma.update then copperplasma.update(dt,state.timePassed) end
if state.birdspritesActive and birdsprites.update then birdsprites.update(dt,state.timePassed) end
if state.C64loadingActive and C64loading.update then C64loading.update(dt,state.timePassed) end
if state.texturetunnelActive and texturetunnel.update then texturetunnel.update(dt,state.timePassed) end
if state.logicrunchlogoActive and logicrunchlogo.update then logicrunchlogo.update(dt,state.timePassed) end
if screenflash.update then screenflash.update(dt,state.timePassed) end
if seagullalert.update then seagullalert.update(dt,state.timePassed) end
if state.guruActive and gurumeditation.isFinished and gurumeditation.isFinished() then
state.guruActive=false end
if state._quitArmed and state.timePassed>=152.680 then
state._quitArmed=false
love.mouse.setVisible(true)
love.event.quit() end
end) end
function love.draw()
withVirtualSize(function()
love.graphics.setCanvas(state.renderCanvas)
love.graphics.clear(0,0,0,1)
if state.copperplasmaActive and copperplasma.draw then copperplasma.draw() end
if state.starScrollerActive and starscroller.draw then starscroller.draw() end
if state.starfieldActive and starfield.draw then starfield.draw() end
if state.logo3dActive and logo3dcycle.draw then logo3dcycle.draw() end
if state.guruActive and gurumeditation.draw then gurumeditation.draw() end
if state.endscreenActive and endscreen.draw then endscreen.draw() end
if state.C64loadingActive and C64loading.draw then C64loading.draw() end
if state.colordotsActive and colordots.draw then colordots.draw() end
if state.birddotsActive and birddots.draw then birddots.draw() end
if state.texturetunnelActive and texturetunnel.draw then texturetunnel.draw() end
if seagullalert.draw then seagullalert.draw() end
if state.spectrumActive and spectrumanalyzer.draw then spectrumanalyzer.draw() end
if randomshit.draw then randomshit.draw() end
if state.logicrunchlogoActive and logicrunchlogo.draw then logicrunchlogo.draw() end
if state.seagullFlyingActive and seagullflying.draw then seagullflying.draw() end
if state.birdspritesActive and birdsprites.draw then birdsprites.draw() end
if state.cubesActive and cubes.draw then cubes.draw() end
if state.vortexActive and vortex.draw then vortex.draw() end
if state.onebirdActive and onebird.draw then onebird.draw() end
if screenflash.draw then screenflash.draw() end
love.graphics.setCanvas() end)
local winW,winH=love.graphics.getDimensions()
local targetW,targetH=1920,1080
local scale=math.min(winW/targetW,winH/targetH)
local drawW,drawH=targetW*scale,targetH*scale
local dx=(winW-drawW)*0.5
local dy=(winH-drawH)*0.5
love.graphics.clear(0,0,0,1)
love.graphics.setColor(1,1,1,1)
love.graphics.draw(state.renderCanvas,dx,dy,0,scale,scale)
love.graphics.setFont(state.mainFont) end
function love.quit()
love.mouse.setVisible(true)
end
