local gc=love.graphics local rnd,sin,cos=math.random,math.sin,math.cos local setFont,mStr=FONT.set,GC.mStr local tau=math.pi*2 local state local timer local ang,pos local hit,dist local side,count local needReset local function new() if needReset then side=math.max(side-2,6) needReset=false else side=side+1 end count=0 for c=1,side do hit[c]=0 dist[c]=rnd(80,270)+637.5 end end local scene={} function scene.enter() state=0 ang,pos=0,-tau/4 timer=50 hit,dist={},{} side=rnd(3,6)*2 needReset=true for c=1,side,2 do hit[c],hit[c+1]=rnd(2),rnd(2) dist[c],dist[c+1]=226,126 end BG.set('none') BGM.play('dream') DiscordRPC.update("Playing polyforge") end function scene.keyDown(key,isRep) if isRep then return end if key=='escape' then if tryBack() then SCN.back() end elseif key=='space' then if state==0 then-- main if timer==0 then state=1 end elseif state==3 then-- play local c=(math.floor((pos-ang)*side/tau)-1)%side+1 if hit[c]==0 then hit[c]=1 count=count+1 SFX.play(side<26 and 'ren_'..rnd(5) or 'ren_'..rnd(6,11)) if count>=12 then SFX.play('ren_mega',(count-11)/15) end if count==side then state=1 SFX.play('spin_0') else SFX.play('lock') end else hit[c]=2 SFX.play('emit') needReset=true state=1 end end end end function scene.mouseDown(_,_,k) if k==1 then scene.keyDown('space') end end function scene.touchDown() scene.keyDown('space') end function scene.update() if state==0 then-- main ang=ang-.02 if ang>0 then ang=ang-tau end if pos0 then timer=timer-1 end elseif state==1 or state==2 then-- zoom ang=ang+.02+timer/260 pos=pos-.016 if ang>0 then ang=ang-tau end if pos0 then ang=ang-tau end if pos