diff --git a/Zenitha b/Zenitha index 9f34716d..752156ef 160000 --- a/Zenitha +++ b/Zenitha @@ -1 +1 @@ -Subproject commit 9f34716d6dff7c4882451205d3e869cfb9618805 +Subproject commit 752156ef3a4ef7e0585f3fde4a26ec12fe82b649 diff --git a/assets/background/fixColor.lua b/assets/background/fixColor.lua new file mode 100644 index 00000000..7bc8b9aa --- /dev/null +++ b/assets/background/fixColor.lua @@ -0,0 +1,10 @@ +-- Customizable grey background +local back={} +local r,g,b=.26,.26,.26 +function back.draw() + GC.clear(r,g,b) +end +function back.event(_r,_g,_b) + r,g,b=_r,_g,_b +end +return back diff --git a/assets/gamefunc.lua b/assets/gamefunc.lua index 2068ce00..c4fb6b39 100644 --- a/assets/gamefunc.lua +++ b/assets/gamefunc.lua @@ -189,7 +189,10 @@ function task_unloadGame() collectgarbage() end -local isKeyDown=love.keyboard.isDown +getTouches=love.touch.getTouches +isMouseDown=love.mouse.isDown +isKeyDown=love.keyboard.isDown +local isKeyDown=isKeyDown function isCtrlPressed() return isKeyDown('lctrl','rctrl') end function isShiftPressed() return isKeyDown('lshift','rshift') end function isAltPressed() return isKeyDown('lalt','ralt') end diff --git a/assets/scene/app_15p.lua b/assets/scene/app_15p.lua index 231ba7b2..ca2028b0 100644 --- a/assets/scene/app_15p.lua +++ b/assets/scene/app_15p.lua @@ -17,7 +17,7 @@ local function notGaming( ) return state~=1 end local colorSelector=WIDGET.new{type='selector',pos={0,0},x=150,y=240,w=200,text="Color",labelPos='top',labelDistance=20,list={'color1','rainbow','color2','gray','black'},disp=function() return color end,code=function(v) if state~=1 then color=v end end,visibleTick=notGaming} function scene.enter() - BG.set('rainbow2') + BG.set('space') board={{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}} cx,cy=4,4 startTime=0 @@ -167,7 +167,7 @@ function scene.keyDown(key,isRep) revKB=not revKB end elseif key=='escape' then - SCN.back() + if sureCheck('back') then SCN.back() end end return true end @@ -312,13 +312,13 @@ function scene.draw() end scene.widgetList={ - WIDGET.new{type='button', pos={0,0},x=160, y=100,w=180,h=100,color='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'space'}, + WIDGET.new{type='button_fill',pos={0,0},x=160, y=100,w=180,h=100,color='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'space'}, colorSelector, - WIDGET.new{type='checkBox',pos={0,.5},x=240, y=-150,text="Invis",widthLimit=200,fontSize=40,disp=function() return invis end, code=WIDGET.c_pressKey'w',visibleTick=notGaming}, - WIDGET.new{type='checkBox',pos={0,.5},x=240, y=-50, text="Slide",widthLimit=200,fontSize=40,disp=function() return slide end, code=WIDGET.c_pressKey'e',visibleTick=notGaming}, - WIDGET.new{type='checkBox',pos={0,.5},x=240, y=50, text="Path", widthLimit=200,fontSize=40,disp=function() return pathVis end,code=WIDGET.c_pressKey'r',visibleTick=function() return state~=1 and slide end}, - WIDGET.new{type='checkBox',pos={0,.5},x=240, y=150, text="RevKB",widthLimit=200,fontSize=40,disp=function() return revKB end, code=WIDGET.c_pressKey't',visibleTick=notGaming}, - WIDGET.new{type='button', pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, + WIDGET.new{type='checkBox', pos={0,.5},x=240, y=-150,text="Invis",widthLimit=200,fontSize=40,disp=function() return invis end, code=WIDGET.c_pressKey'w',visibleTick=notGaming}, + WIDGET.new{type='checkBox', pos={0,.5},x=240, y=-50, text="Slide",widthLimit=200,fontSize=40,disp=function() return slide end, code=WIDGET.c_pressKey'e',visibleTick=notGaming}, + WIDGET.new{type='checkBox', pos={0,.5},x=240, y=50, text="Path", widthLimit=200,fontSize=40,disp=function() return pathVis end,code=WIDGET.c_pressKey'r',visibleTick=function() return state~=1 and slide end}, + WIDGET.new{type='checkBox', pos={0,.5},x=240, y=150, text="RevKB",widthLimit=200,fontSize=40,disp=function() return revKB end, code=WIDGET.c_pressKey't',visibleTick=notGaming}, + WIDGET.new{type='button_fill',pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, } return scene diff --git a/assets/scene/app_2048.lua b/assets/scene/app_2048.lua index 191cb25a..e9ef351f 100644 --- a/assets/scene/app_2048.lua +++ b/assets/scene/app_2048.lua @@ -1,5 +1,5 @@ local gc=love.graphics -local setColor,rectangle=gc.setColor,gc.rectangle +local gc_setColor,gc_rectangle=gc.setColor,gc.rectangle local floor,abs=math.floor,math.abs local rnd,min=math.random,math.min @@ -127,7 +127,7 @@ local function freshMaxTile() if maxTile==12 then skipper.cd=0 end - FMOD.effect('reach') + FMOD.effect('beep_notice') table.insert(progress,("%s - %.3fs"):format(tileName[maxTile],love.timer.getTime()-startTime)) end local function squash(L) @@ -224,7 +224,7 @@ local function skip() newTile() FMOD.effect('hold') else - FMOD.effect('finesseError') + FMOD.effect('beep_down') end end end @@ -233,7 +233,7 @@ function scene.enter() for i=1,#tileName do tileText[i]=gc.newText(FONT.get(80,'_norm'),tileName[i]) end - BG.set('cubes') + BG.set('space') invis=false tapControl=false @@ -361,13 +361,13 @@ function scene.draw() -- Field gc.setLineWidth(10) if state==2 then - setColor(.9,.9,0)-- win + gc_setColor(.9,.9,0)-- win elseif state==1 then - setColor(.9,.9,.9)-- game + gc_setColor(.9,.9,.9)-- game elseif state==0 then - setColor(.2,.8,.2)-- ready + gc_setColor(.2,.8,.2)-- ready end - rectangle('line',field.x-10,field.y-10,field.w+20,field.w+20,25) + gc_rectangle('line',field.x-10,field.y-10,field.w+20,field.w+20,25) for i=1,16 do if field[i] then @@ -377,22 +377,22 @@ function scene.draw() local textScale=min(field.r/tileText[N]:getWidth(),field.r/tileText[N]:getHeight())/1.26 if i~=prevPos or prevSpawnTime==1 then if not invis or i==prevPos then - setColor(tileColor[N] or COLOR.D) - rectangle('fill',x,y,r-6,r-6,15) + gc_setColor(tileColor[N] or COLOR.D) + gc_rectangle('fill',x,y,r-6,r-6,15) if N>=0 then - setColor(N<3 and COLOR.D or COLOR.L) + gc_setColor(N<3 and COLOR.D or COLOR.L) GC.mDraw(tileText[N],x+r/2,y+r/2,nil,textScale) end else - setColor(COLOR.DL) - rectangle('fill',x,y,r-6,r-6,15) + gc_setColor(COLOR.DL) + gc_rectangle('fill',x,y,r-6,r-6,15) end else local c=tileColor[N] - setColor(c[1],c[2],c[3],prevSpawnTime) - rectangle('fill',x,y,r-6,r-6,15) + gc_setColor(c[1],c[2],c[3],prevSpawnTime) + gc_rectangle('fill',x,y,r-6,r-6,15) c=N<3 and 0 or 1 - setColor(c,c,c,prevSpawnTime) + gc_setColor(c,c,c,prevSpawnTime) GC.mDraw(tileText[N],x+r/2,y+r/2,nil,textScale) end end @@ -401,38 +401,38 @@ function scene.draw() -- New tile position local x,y=1+(prevPos-1)%4,floor((prevPos+3)/4) gc.setLineWidth(8) - setColor(.2,.8,0,prevSpawnTime) + gc_setColor(.2,.8,0,prevSpawnTime) local d=25-prevSpawnTime*25 - rectangle('line',field.x+field.r*(x-1)+3-d,field.y+field.r*(y-1)+3-d,field.r-6+2*d,field.r-6+2*d,15) + gc_rectangle('line',field.x+field.r*(x-1)+3-d,field.y+field.r*(y-1)+3-d,field.r-6+2*d,field.r-6+2*d,15) -- Time and moves FONT.set(50) - setColor(1,1,1) + gc_setColor(COLOR.L) gc.print(("%.3f"):format(time),1300,10) gc.print(move,1300,60) -- Progress time list FONT.set(20) - setColor(.6,.6,.6) + gc_setColor(.6,.6,.6) for i=1,#progress do gc.print(progress[i],1300,120+20*i) end -- Score FONT.set(40) - setColor(1,.7,.7) + gc_setColor(1,.7,.7) GC.mStr(score,field.x+field.w+180,700) -- Touch control border line if tapControl then gc.setLineWidth(6) - setColor(1,1,1,.2) + gc_setColor(1,1,1,.2) local r=field.w*.4 gc.line(field.x,field.y,field.x+r,field.y+r) gc.line(field.x+field.w,field.y,field.x+field.w-r,field.y+r) gc.line(field.x,field.y+field.w,field.x+r,field.y+field.w-r) gc.line(field.x+field.w,field.y+field.w,field.x+field.w-r,field.y+field.w-r) - rectangle('line',field.x+r,field.y+r,field.w*.2,field.w*.2,10) + gc_rectangle('line',field.x+r,field.y+r,field.w*.2,field.w*.2,10) end -- Skip mark @@ -442,7 +442,7 @@ function scene.draw() -- Skip cooldown gc.replaceTransform(SCR.xOy_dl) - setColor(1,1,.5) + gc_setColor(1,1,.5) if skipper.cd and skipper.cd>0 then FONT.set(50) GC.mStr(skipper.cd,180,-420) @@ -453,57 +453,58 @@ function scene.draw() gc.setLineWidth(6) FONT.set(30) for i=1,2 do - setColor(COLOR[ + gc_setColor( repeater.focus==i and ( love.timer.getTime()%.5>.25 and - 'R' or 'Y' + COLOR.R or COLOR.Y ) or ( repeater.seq[i]==repeater.last[i] and - 'DL' or 'L' + COLOR.DL or COLOR.L ) - ]) - rectangle('line',-265,-115+60*i,250,50,5) + ) + gc_rectangle('line',-265,-115+60*i,250,50,5) gc.print(repeater.seq[i],-260,-150+100*i) end -- Next & Next indicator gc.replaceTransform(SCR.xOy_l) FONT.set(60) + gc_setColor(COLOR.L) gc.print("Next",50,-35) - if nextTile>1 then setColor(1,.5,.4) end + if nextTile>1 then gc_setColor(1,.5,.4) end FONT.set(100) GC.mStr(tileName[nextTile],270,-65) if nextCD<=12 then - setColor(1,1,1) + gc_setColor(COLOR.L) for i=1,nextCD do - rectangle('fill',130+i*20-nextCD*8,-70,16,16) + gc_rectangle('fill',130+i*20-nextCD*8,-70,16,16) end end -- Draw no-setting area gc.replaceTransform(SCR.xOy_ul) if state==2 then - setColor(1,0,0,.3) - rectangle('fill',30,190,300,140) + gc_setColor(1,0,0,.3) + gc_rectangle('fill',30,190,300,140) end end local function visFunc1() return not tapControl end scene.widgetList={ - WIDGET.new{type='button', pos={0,0},x=160,y=100,w=180,h=100,color='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r'}, - WIDGET.new{type='checkBox',pos={0,0},x=300,y=220,text="Invis",widthLimit=270,fontSize=40,disp=function() return invis end,code=WIDGET.c_pressKey'q',visibleTick=function() return state~=1 end}, - WIDGET.new{type='checkBox',pos={0,0},x=300,y=300,text="Tap",widthLimit=270,fontSize=40,disp=function() return tapControl end,code=WIDGET.c_pressKey'w',visibleTick=function() return state~=1 end}, - - WIDGET.new{type='button', pos={0,1},x=180,y=-280,w=100,text="↑",fontSize=50,color='Y',code=WIDGET.c_pressKey'up', visibleTick=visFunc1}, - WIDGET.new{type='button', pos={0,1},x=180,y=-80, w=100,text="↓",fontSize=50,color='Y',code=WIDGET.c_pressKey'down', visibleTick=visFunc1}, - WIDGET.new{type='button', pos={0,1},x=80, y=-180,w=100,text="←",fontSize=50,color='Y',code=WIDGET.c_pressKey'left', visibleTick=visFunc1}, - WIDGET.new{type='button', pos={0,1},x=280,y=-180,w=100,text="→",fontSize=50,color='Y',code=WIDGET.c_pressKey'right',visibleTick=visFunc1}, - WIDGET.new{type='button', pos={0,1},x=180,y=-390,w=100,text="S",fontSize=50,color='Y',code=WIDGET.c_pressKey'space',visibleTick=function() return state==1 and skipper.cd==0 end}, - WIDGET.new{type='button', pos={1,.5},x=-140,y=-30,w=250,h=50, color='lX',code=WIDGET.c_pressKey'1', visibleTick=function() return state~=2 end}, - WIDGET.new{type='button', pos={1,.5},x=-140,y=30,w=250,h=50, color='lX',code=WIDGET.c_pressKey'2', visibleTick=function() return state~=2 end}, - WIDGET.new{type='button', pos={1,.5},x=-300,y=-30,w=50,text=">",fontSize=50,color='R',code=WIDGET.c_pressKey'c1', visibleTick=function() return state~=2 and #repeater.seq[1]~=0 end}, - WIDGET.new{type='button', pos={1,.5},x=-300,y=30,w=50, text=">",fontSize=50,color='R',code=WIDGET.c_pressKey'c2', visibleTick=function() return state~=2 and #repeater.seq[2]~=0 end}, - WIDGET.new{type='button', pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, + WIDGET.new{type='button', pos={0,0}, x=160, y=100,w=180,h=100,color='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r'}, + WIDGET.new{type='checkBox',pos={0,0}, x=300, y=220,text="Invis",widthLimit=270,fontSize=40,disp=function() return invis end, code=WIDGET.c_pressKey'q',visibleTick=function() return state~=1 end}, + WIDGET.new{type='checkBox',pos={0,0}, x=300, y=300,text="Tap", widthLimit=270,fontSize=40,disp=function() return tapControl end,code=WIDGET.c_pressKey'w',visibleTick=function() return state~=1 end}, + + WIDGET.new{type='button', pos={0,1}, x=180, y=-280,w=100, sound_trigger=false,text="↑",fontSize=50,color='Y', code=WIDGET.c_pressKey'up', visibleTick=visFunc1}, + WIDGET.new{type='button', pos={0,1}, x=180, y=-80, w=100, sound_trigger=false,text="↓",fontSize=50,color='Y', code=WIDGET.c_pressKey'down', visibleTick=visFunc1}, + WIDGET.new{type='button', pos={0,1}, x=80, y=-180,w=100, sound_trigger=false,text="←",fontSize=50,color='Y', code=WIDGET.c_pressKey'left', visibleTick=visFunc1}, + WIDGET.new{type='button', pos={0,1}, x=280, y=-180,w=100, sound_trigger=false,text="→",fontSize=50,color='Y', code=WIDGET.c_pressKey'right',visibleTick=visFunc1}, + WIDGET.new{type='button', pos={0,1}, x=180, y=-390,w=100, sound_trigger=false,text="S",fontSize=50,color='Y', code=WIDGET.c_pressKey'space',visibleTick=function() return state==1 and skipper.cd==0 end}, + WIDGET.new{type='button', pos={1,.5},x=-140,y=-30, w=250,h=50,sound_trigger=false, color='lX',code=WIDGET.c_pressKey'1', visibleTick=function() return state~=2 end}, + WIDGET.new{type='button', pos={1,.5},x=-140,y=30, w=250,h=50,sound_trigger=false, color='lX',code=WIDGET.c_pressKey'2', visibleTick=function() return state~=2 end}, + WIDGET.new{type='button', pos={1,.5},x=-300,y=-30, w=50, sound_trigger=false,text=">",fontSize=50,color='R', code=WIDGET.c_pressKey'c1', visibleTick=function() return state~=2 and #repeater.seq[1]~=0 end}, + WIDGET.new{type='button', pos={1,.5},x=-300,y=30, w=50, sound_trigger=false,text=">",fontSize=50,color='R', code=WIDGET.c_pressKey'c2', visibleTick=function() return state~=2 and #repeater.seq[2]~=0 end}, + WIDGET.new{type='button', pos={1,1}, x=-120,y=-80, w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, } return scene diff --git a/assets/scene/app_AtoZ.lua b/assets/scene/app_AtoZ.lua index a4fe6f45..62f4dafc 100644 --- a/assets/scene/app_AtoZ.lua +++ b/assets/scene/app_AtoZ.lua @@ -31,7 +31,7 @@ local state,progress=0 local frameKeyCount,mistake function scene.enter() - BG.set('rgb') + BG.set('space') levelName="A_Z" targetString=levels.A_Z progress=1 @@ -58,23 +58,23 @@ function scene.keyDown(key,isRep) style='score', duration=.4, } - FMOD.effect('touch') + FMOD.effect('inputbox_input') if progress==2 then state=1 startTime=love.timer.getTime() elseif progress>#targetString then time=love.timer.getTime()-startTime state=2 - FMOD.effect('reach') + FMOD.effect('beep_rise') end elseif progress>1 then mistake=mistake+1 - FMOD.effect('finesseError') + FMOD.effect('rotate_failed') end end elseif key=='left' or key=='right' then if state==0 then - scene.widgetList.level:scroll(key=='left' and 1 or -1,0) + scene.widgetList.level:arrowKey(key) end elseif key=='space' then progress=1 @@ -82,7 +82,7 @@ function scene.keyDown(key,isRep) time=0 state=0 elseif key=='escape' then - SCN.back() + if sureCheck('back') then SCN.back() end end return true end @@ -117,7 +117,7 @@ function scene.draw() gc.setColor(COLOR.L) gc.print(targetString:sub(progress,progress),120,280,0,2) - gc.print(targetString:sub(progress+1),310,380) + gc.print(targetString:sub(progress+1),300,380) gc.setColor(1,1,1,.7) FONT.set(40) diff --git a/assets/scene/app_UTTT.lua b/assets/scene/app_UTTT.lua index a2d09ccb..15692b4f 100644 --- a/assets/scene/app_UTTT.lua +++ b/assets/scene/app_UTTT.lua @@ -74,7 +74,7 @@ local function place(X,x) return end end - FMOD.effect('reach') + FMOD.effect('beep_rise') else if full(board[X]) then FMOD.effect('emit') @@ -98,7 +98,7 @@ local scene={} function scene.enter() restart() - BG.set('rainbow') + BG.set('space') end function scene.mouseMove(x,y) diff --git a/assets/scene/app_calc.lua b/assets/scene/app_calc.lua index 0c637789..e8190e65 100644 --- a/assets/scene/app_calc.lua +++ b/assets/scene/app_calc.lua @@ -18,7 +18,6 @@ end function scene.enter() BG.set('none') - stopBgm() reg,val,sym=false,"0",false end @@ -112,7 +111,7 @@ function scene.keyDown(key) if val~="0" then reg,sym=false,false val="0" - else + elseif sureCheck('back') then SCN.back() end elseif key=='delete' then @@ -122,37 +121,39 @@ function scene.keyDown(key) end function scene.draw() - GC.replaceTransform(SCR.xOy_ul) + gc.translate(260,80) + gc.setLineWidth(2) + gc.setColor(COLOR.L) + gc.rectangle('line',0,0,740,250,10) gc.setColor(COLOR.dX) - gc.rectangle('fill',100,80,650,150,5) + gc.rectangle('fill',0,0,740,250,10) + FONT.set(70) gc.setColor(COLOR.L) - gc.setLineWidth(2) - gc.rectangle('line',100,80,650,150,5) - FONT.set(45) - if reg then gc.printf(reg,0,100,720,'right') end - if val then gc.printf(val,0,150,720,'right') end - if sym then FONT.set(50) gc.print(sym,126,150) end + if reg then gc.printf(reg,0,30,700,'right') end + if val then gc.printf(val,0,130,700,'right') end + FONT.set(85) + if sym then gc.printf(sym,26,125,260) end end scene.widgetList={ - WIDGET.new{type='button',pos={0,0},x=145,y=300,w=90,sound_trigger=false,text="1",fontSize=50,code=WIDGET.c_pressKey'1'}, - WIDGET.new{type='button',pos={0,0},x=245,y=300,w=90,sound_trigger=false,text="2",fontSize=50,code=WIDGET.c_pressKey'2'}, - WIDGET.new{type='button',pos={0,0},x=345,y=300,w=90,sound_trigger=false,text="3",fontSize=50,code=WIDGET.c_pressKey'3'}, - WIDGET.new{type='button',pos={0,0},x=145,y=400,w=90,sound_trigger=false,text="4",fontSize=50,code=WIDGET.c_pressKey'4'}, - WIDGET.new{type='button',pos={0,0},x=245,y=400,w=90,sound_trigger=false,text="5",fontSize=50,code=WIDGET.c_pressKey'5'}, - WIDGET.new{type='button',pos={0,0},x=345,y=400,w=90,sound_trigger=false,text="6",fontSize=50,code=WIDGET.c_pressKey'6'}, - WIDGET.new{type='button',pos={0,0},x=145,y=500,w=90,sound_trigger=false,text="7",fontSize=50,code=WIDGET.c_pressKey'7'}, - WIDGET.new{type='button',pos={0,0},x=245,y=500,w=90,sound_trigger=false,text="8",fontSize=50,code=WIDGET.c_pressKey'8'}, - WIDGET.new{type='button',pos={0,0},x=345,y=500,w=90,sound_trigger=false,text="9",fontSize=50,code=WIDGET.c_pressKey'9'}, - WIDGET.new{type='button',pos={0,0},x=145,y=600,w=90,sound_trigger=false,text="0",fontSize=50,code=WIDGET.c_pressKey'0'}, - WIDGET.new{type='button',pos={0,0},x=245,y=600,w=90,sound_trigger=false,text=".",color='lM',fontSize=50,code=WIDGET.c_pressKey'.'}, - WIDGET.new{type='button',pos={0,0},x=345,y=600,w=90,sound_trigger=false,text="e",color='lM',fontSize=50,code=WIDGET.c_pressKey'e'}, - WIDGET.new{type='button',pos={0,0},x=445,y=300,w=90,sound_trigger=false,text="+",color='lB',fontSize=50,code=WIDGET.c_pressKey'+'}, - WIDGET.new{type='button',pos={0,0},x=445,y=400,w=90,sound_trigger=false,text="-",color='lB',fontSize=50,code=WIDGET.c_pressKey'-'}, - WIDGET.new{type='button',pos={0,0},x=445,y=500,w=90,sound_trigger=false,text="*",color='lB',fontSize=50,code=WIDGET.c_pressKey'*'}, - WIDGET.new{type='button',pos={0,0},x=445,y=600,w=90,sound_trigger=false,text="/",color='lB',fontSize=50,code=WIDGET.c_pressKey'/'}, - WIDGET.new{type='button',pos={0,0},x=545,y=300,w=90,sound_trigger=false,text=CHAR.key.backspace,color='lR',fontSize=50,code=WIDGET.c_pressKey'backspace'}, - WIDGET.new{type='button',pos={0,0},x=545,y=400,w=90,sound_trigger=false,text="=",color='lY',fontSize=50,code=WIDGET.c_pressKey'return'}, + WIDGET.new{type='button',x=330,y=420,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'1', text="1"}, + WIDGET.new{type='button',x=480,y=420,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'2', text="2"}, + WIDGET.new{type='button',x=630,y=420,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'3', text="3"}, + WIDGET.new{type='button',x=330,y=570,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'4', text="4"}, + WIDGET.new{type='button',x=480,y=570,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'5', text="5"}, + WIDGET.new{type='button',x=630,y=570,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'6', text="6"}, + WIDGET.new{type='button',x=330,y=720,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'7', text="7"}, + WIDGET.new{type='button',x=480,y=720,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'8', text="8"}, + WIDGET.new{type='button',x=630,y=720,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'9', text="9"}, + WIDGET.new{type='button',x=330,y=870,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'0', text="0"}, + WIDGET.new{type='button',x=480,y=870,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'.', color='lM',text="."}, + WIDGET.new{type='button',x=630,y=870,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'e', color='lM',text="e"}, + WIDGET.new{type='button',x=780,y=420,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'+', color='lB',text="+"}, + WIDGET.new{type='button',x=780,y=570,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'-', color='lB',text="-"}, + WIDGET.new{type='button',x=780,y=720,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'*', color='lB',text="*"}, + WIDGET.new{type='button',x=780,y=870,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'/', color='lB',text="/"}, + WIDGET.new{type='button',x=930,y=420,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'backspace',color='lR',text=CHAR.key.backspace}, + WIDGET.new{type='button',x=930,y=570,w=140,sound_trigger=false,fontSize=80,code=WIDGET.c_pressKey'return', color='lY',text="="}, WIDGET.new{type='button',pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, } diff --git a/assets/scene/app_cubefield.lua b/assets/scene/app_cubefield.lua index 327ee901..da95488a 100644 --- a/assets/scene/app_cubefield.lua +++ b/assets/scene/app_cubefield.lua @@ -95,7 +95,7 @@ end function scene.keyDown(key,isRep) if isRep then return true end if key=='escape' then - SCN.back() + if sureCheck('back') then SCN.back() end elseif play then if key=='left' or key=='a' then moveDir=-1 @@ -187,7 +187,7 @@ function scene.update(dt) speed=speed+.2 end level=level+1 - FMOD.effect('warn_1') + FMOD.effect('beep_notice') end sunH=sunH+.01 elseif menu==1 then diff --git a/assets/scene/app_dropper.lua b/assets/scene/app_dropper.lua index 608a322c..963565c4 100644 --- a/assets/scene/app_dropper.lua +++ b/assets/scene/app_dropper.lua @@ -1,5 +1,6 @@ local gc=love.graphics -local rnd,int,max=math.random,math.floor,math.max +local rnd,int=math.random,math.floor +local max,min=math.max,math.min local setFont,mStr=FONT.set,GC.mStr -- This mini-game is written for TI-nSpire CX CAS many years ago. @@ -16,22 +17,29 @@ local scene={} local highScore,highFloor=0,0 local move,base local state,message -local speed +local moveDir local score,floor,camY -local color1,color2={},{} +local color1,color2 + +local moveSpeed=10 +local dropSpeed=22 +local shortenSpeed=6 +local climbSpeed=4 +local brickHeight=50 + +local overflowWidth=420 +local brickStroke=5 local function restart() - move={x=0,y=260,l=500} - base={x=40,y=690,l=1200} + move={x=0,y=260,w=500} + base={x=100,y=SCR.h0-brickHeight,w=1400} message="Welcome" - speed=10 + moveDir=1 score=0 floor=0 camY=0 - for i=1,3 do - color1[i]=rnd() - color2[i]=rnd() - end + color1=COLOR.random(3) + color2=COLOR.random(3) end function scene.enter() @@ -44,18 +52,14 @@ function scene.keyDown(key,isRep) if isRep then return true end if key=='space' or key=='return' then if state=='move' then - if floor>0 then - if move.xbase.x then - move.x=move.x-10 - end + if floor>0 and math.abs(move.x-base.x)<10 then + move.x=base.x end FMOD.effect('hold') state='drop' elseif state=='dead' then - move.x,move.y,move.l=1e99,0,0 - base.x,base.y,base.l=1e99,0,0 + move.x,move.y,move.w=1e99,0,0 + base.x,base.y,base.w=1e99,0,0 state='scroll' elseif state=='menu' then restart() @@ -75,82 +79,81 @@ function scene.touchDown() scene.keyDown('space') end -function scene.update() +function scene.update(dt) + dt=dt*60 -- Second to Frame if state=='move' then - move.x=move.x+speed - if speed<0 and move.x<=0 or speed>0 and move.x+move.l>=1280 then + move.x=move.x+moveSpeed*moveDir*dt + if moveDir<0 and move.x<=0 or moveDir>0 and move.x+move.w>=SCR.w0 then FMOD.effect('lock') - speed=-speed + moveDir=-moveDir end elseif state=='drop' then - move.y=move.y+18 - if move.y>=660 then - if move.x>base.x+base.l or move.x+move.l=SCR.h0-2*brickHeight then + if move.x>base.x+base.w or move.x+move.w0 and move.x==base.x then - FMOD.effect('ren_mega') - end + move.y=SCR.h0-2*brickHeight + comboSound(math.floor(floor/2)+1) + FMOD.effect(move.x==base.x and 'clear_3' or 'clear_2',{volume=.6}) state='shorten' end end elseif state=='shorten' then - if move.x>base.x+base.l or move.x+move.lbase.x+base.w or move.x+move.wbase.x+base.l then - move.l=move.l-5 + local d=min(shortenSpeed*dt,base.x-move.x) + move.x=move.x+d + move.w=move.w-d + elseif move.x+move.w>base.x+base.w then + local d=min(shortenSpeed*dt,(move.x+move.w)-(base.x+base.w)) + move.w=move.w-d else state='climb' end elseif state=='climb' then - if base.y<720 then - move.y=move.y+3 - base.y=base.y+3 - camY=camY+3 + if base.y1000 then + move.y=move.y+dropSpeed*dt + if move.y>=SCR.h0 then + move.y=SCR.h0 highScore=max(score,highScore) highFloor=max(floor,floor) state='dead' end elseif state=='scroll' then - camY=camY-floor/4 - if camY<1000 then camY=camY-1 end - if camY<500 then camY=camY-1 end - if camY<0 then + camY=camY-(2.6+floor/6.2+camY/626)*dt + if camY<=0 then restart() state='move' end @@ -175,67 +178,61 @@ end setmetatable(backColor,backColor) function scene.draw() -- Background - local lv,height=int(camY/700),camY%700 + local lv,height=int(camY/(SCR.h0-brickHeight)),camY%(SCR.h0-brickHeight) gc.setColor(backColor[lv+1] or COLOR.D) - gc.rectangle('fill',0,720,1280,height-700) + gc.rectangle('fill',-overflowWidth,SCR.h0,SCR.w0+overflowWidth*2,height-(SCR.h0-brickHeight)) gc.setColor(backColor[lv+2] or COLOR.D) - gc.rectangle('fill',0,height+20,1280,-height-20) + gc.rectangle('fill',-overflowWidth,height+brickHeight,SCR.w0+overflowWidth*2,-height-brickHeight) if height-680>0 then gc.setColor(backColor[lv+3] or COLOR.D) - gc.rectangle('fill',0,height-680,1280,680-height) + gc.rectangle('fill',0,height-680,SCR.w0,680-height) end if state=='menu' or state=='dead' then setFont(100) + GC.shadedPrint("DROPPER",800,150,'center',4,8,COLOR.L,COLOR.L) gc.setColor(COLOR.rainbow_light(love.timer.getTime()*2.6)) - mStr("DROPPER",800,120) + mStr("DROPPER",800,150) gc.setColor(COLOR.rainbow_gray(love.timer.getTime()*1.626)) - setFont(55) - mStr("Score - "..score,800,290) - mStr("High Score - "..highScore,800,370) - mStr("High Floor - "..highFloor,800,450) + setFont(70) + mStr("Score - "..score,800,400) + mStr("High Score - "..highScore,800,500) + mStr("High Floor - "..highFloor,800,600) gc.setColor(COLOR.D) - setFont(35) - mStr(MOBILE and "Touch to Start" or "Press space to Start",800,570) - setFont(20) - gc.print("Original CX-CAS version by MrZ",740,235) - gc.print("Ported / Rewritten / Balanced by MrZ",740,260) + setFont(50) + mStr(MOBILE and "Touch to Start" or "Press space to Start",800,800) + setFont(25) + gc.print("Original CX-CAS version by MrZ",740,265) + gc.print("Ported / Rewritten / Balanced by MrZ",740,290) end if state~='menu' then -- High floor gc.setColor(COLOR.L) - gc.setLineWidth(2) - local y=690+camY-30*highFloor - gc.line(0,y,1280,y) + gc.setLineWidth(3) + local y=SCR.h0+camY-brickHeight*highFloor + gc.line(-overflowWidth,y,SCR.w0+overflowWidth,y) - gc.setLineWidth(6) - gc.rectangle('line',move.x-3,move.y-3,move.l+6,36) - gc.rectangle('line',base.x-3,base.y-3,base.l+6,36) + setFont(60) + GC.shadedPrint(floor+1,move.x+move.w+10,move.y-15,'left',3,8,COLOR.L,COLOR.D) + GC.shadedPrint(floor,base.x+base.w+10,base.y-15,'left',3,8,COLOR.L,COLOR.D) - setFont(45) - gc.print(floor+1,move.x+move.l+15,move.y-18) - gc.print(floor,base.x+base.l+15,base.y-18) - - gc.setColor(COLOR.L) - mStr(message,800,0) - gc.setColor(COLOR.D) - mStr(message,643,2) + GC.shadedPrint(message,800,0,'center',3,8,COLOR.L,COLOR.D) setFont(70) - gc.setColor(COLOR.L) - gc.print(score,60,40) - gc.setColor(COLOR.D) - gc.print(score,64,43) + GC.shadedPrint(score,100,40,'center',3,8,COLOR.L,COLOR.D) - gc.setColor(color1) gc.rectangle('fill',move.x,move.y,move.l,30) - gc.setColor(color2) gc.rectangle('fill',base.x,base.y,base.l,30) + gc.setColor(COLOR.L) + gc.rectangle('fill',move.x-brickStroke,move.y-brickStroke,move.w+2*brickStroke,brickHeight+2*brickStroke) + gc.rectangle('fill',base.x-brickStroke,base.y-brickStroke,base.w+2*brickStroke,brickHeight+2*brickStroke) + gc.setColor(color1) gc.rectangle('fill',move.x,move.y,move.w,brickHeight) + gc.setColor(color2) gc.rectangle('fill',base.x,base.y,base.w,brickHeight) end end scene.widgetList={ - WIDGET.new{type='button',x=1140,y=60,w=170,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, + WIDGET.new{type='button_fill',pos={1,0},x=-120,y=80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, } return scene diff --git a/assets/scene/app_dtw.lua b/assets/scene/app_dtw.lua index 79196cc3..64a72c5c 100644 --- a/assets/scene/app_dtw.lua +++ b/assets/scene/app_dtw.lua @@ -14,17 +14,19 @@ local targets={ [2600]=true, } +local B={x=400,y=20,w=800,h=960,cw=200,ch=160} + local state,progress local startTime,time local keyTime local speed,maxSpeed -local arcade,rollSpeed +local arcade,rollSpeed,rollAcc local reset=error -- function, defined later -local tileColor="black" +local tileColor="D" local mode="Normal" -local modeSelector=WIDGET.new{type='selector',x=150,y=220,w=290, +local modeSelector=WIDGET.new{type='selector',x=200,y=240,w=290, list={ "Normal", "Split", @@ -40,16 +42,34 @@ local modeSelector=WIDGET.new{type='selector',x=150,y=220,w=290, "Quadstream", },disp=function() return mode end,code=function(m) mode=m reset() end } -local colorSelector=WIDGET.new{type='selector',x=150,y=360,w=290, - list={"black","dGray","gray","lGray","dRed","red","lRed","dFire","fire","lFire","dOrange","orange","lOrange","dYellow","yellow","lYellow","dLime","lime","lLime","dJade","jade","lJade","dGreen","green","lGreen","dAqua","aqua","lAqua","dCyan","cyan","lCyan","dNavy","navy","lNavy","dSea","sea","lSea","dBlue","blue","lBlue","dViolet","violet","lViolet","dPurple","purple","lPurple","dMagenta","magenta","lMagenta","dWine","wine","lWine"}, +local colorSelector=WIDGET.new{type='selector',x=200,y=330,w=290, + list={ + 'D', + 'dR','R','lR', + 'dF','F','lF', + 'dO','O','lO', + 'dY','Y','lY', + 'dA','A','lA', + 'dK','K','lK', + 'dG','G','lG', + 'dJ','J','lJ', + 'dC','C','lC', + 'dI','I','lI', + 'dS','S','lS', + 'dB','B','lB', + 'dP','P','lP', + 'dV','V','lV', + 'dM','M','lM', + 'dW','W','lW' + }, disp=function() return tileColor end,code=function(m) tileColor=m end } -local arcadeSwitch=WIDGET.new{type='checkBox',x=240,y=430,widthLimit=200,fontSize=40,disp=function() return arcade end,code=WIDGET.c_pressKey'e'} +local arcadeSwitch=WIDGET.new{type='checkBox',text="Arcade",x=300,y=430,widthLimit=200,fontSize=40,disp=function() return arcade end,code=WIDGET.c_pressKey'w'} local function freshSelectors() - local f=state~=0 - modeSelector.hide=f - colorSelector.hide=f - arcadeSwitch.hide=f + local f=state==0 + modeSelector._visible=f + colorSelector._visible=f + arcadeSwitch._visible=f end local score @@ -178,13 +198,14 @@ function reset() time=0 score=0 + -- Get speed from clipboard, format: s= local t=love.system.getClipboardText() if type(t)=='string' then - t=t:lower():match("^s=(.+)") - t=t and tonumber(t) and tonumber(t)*2 - t=t and tonumber(t)>=0 and tonumber(t)<=60 and t + rollSpeed,rollAcc=t:match("^s=(.+),(.+)") + rollSpeed,rollAcc=tonumber(rollSpeed),tonumber(rollAcc) end - rollSpeed=type(t)=='number' and t or 6.26 + rollSpeed=rollSpeed or 620 + rollAcc=rollAcc or 26 pos={} while #pos<7 do generator[mode]() end @@ -230,10 +251,10 @@ local function touch(n) state=2 FMOD.effect('win') else - FMOD.effect('reach',{volume=.5}) + FMOD.effect('beep_notice',{volume=.5}) end end - height=height+120 + height=height+B.ch FMOD.effect('lock') end else @@ -248,17 +269,17 @@ function scene.keyDown(key,isRep) if key=='r' or key=='space' then reset() elseif key=='escape' then SCN.back() elseif state~=2 then - if key=='d' or key=='c' then touch(1) + if key=='d' or key=='c' then touch(1) elseif key=='f' or key=='v' then touch(2) elseif key=='j' or key=='n' then touch(3) elseif key=='k' or key=='m' then touch(4) elseif state==0 then if key=='tab' then local mode1=mode - modeSelector:scroll(love.keyboard.isDown('lshift','rshift') and -1 or 1) + modeSelector:scroll(love.keyboard.isDown('lshift','rshift') and 1 or -1,0) if mode1~=mode then reset() end elseif key=='q' then - colorSelector:scroll(love.keyboard.isDown('lshift','rshift') and -1 or 1) + colorSelector:scroll(love.keyboard.isDown('lshift','rshift') and 1 or -1,0) elseif key=='w' then arcade=not arcade end @@ -287,31 +308,30 @@ function scene.update(dt) if speed>maxSpeed then maxSpeed=speed end if arcade then - height=height-rollSpeed - rollSpeed=rollSpeed+.00355 + height=height-rollSpeed*dt + rollSpeed=rollSpeed+rollAcc*dt if height<-120 then state=2 FMOD.effect('clear_2') end else - height=height*.6 + height=MATH.expApproach(height,0,dt*26) end end end -local function boardStencil() gc.rectangle('fill',300,0,680,720) end function scene.draw() setFont(50) if arcade then -- Draw rolling speed - mStr(("%.2f/s"):format(rollSpeed/2),155,490) + mStr(("%.2f/s"):format(rollSpeed/B.ch),200,490) else -- Draw speed - setFont(45) + setFont(60) gc.setColor(1,.6,.6) - mStr(("%.2f"):format(maxSpeed/60),155,460) + mStr(("%.2f"):format(maxSpeed/60),200,500) gc.setColor(COLOR.L) - mStr(("%.2f"):format(speed/60),155,520) + mStr(("%.2f"):format(speed/60),200,600) -- Progress time list setFont(30) @@ -329,56 +349,63 @@ function scene.draw() -- Draw mode if state~=0 then gc.setColor(COLOR.L) - setFont(30) mStr(mode,155,212) + setFont(30) + mStr(mode,200,220) end - -- Draw tiles - gc.stencil(boardStencil) - gc.setStencilTest('equal',1) - gc.rectangle('fill',300,0,680,720) - gc.setColor(COLOR[tileColor]) - gc.push('transform') - gc.translate(0,720-height+8) - for i=1,7 do - local t=pos[i] - while t>0 do - gc.rectangle('fill',130+170*(t%10)+8,-i*120,170-16,120-16) - t=(t-t%10)/10 + gc.translate(B.x,B.y) + GC.stc_reset() + GC.stc_setComp() + GC.stc_rect(0,0,B.w,B.h) + -- Draw tiles + gc.rectangle('fill',0,0,B.w,B.h) + gc.setColor(COLOR[tileColor]) + gc.push('transform') + gc.translate(0,B.h-height+8) + for i=1,7 do + local t=pos[i] + while t>0 do + gc.rectangle('fill',B.cw*(t%10-1)+8,-i*B.ch,B.cw-16,B.ch-16) + t=(t-t%10)/10 + end end - end - gc.pop() - gc.setStencilTest() - -- Draw track line - gc.setColor(COLOR.D) - gc.setLineWidth(2) - for x=1,5 do - x=130+170*x - gc.line(x,0,x,720) - end - for y=0,6 do - y=720-120*y-height%120 - gc.line(300,y,980,y) - end + gc.pop() + + -- Draw red tile + if diePos then + gc.setColor(1,.2,.2) + gc.rectangle('fill',B.cw*(diePos-1)+8,B.h-B.ch-height+8,B.cw-16,B.ch-16) + end + + -- Draw track line + gc.setColor(COLOR.D) + gc.setLineWidth(2) + for x=1,5 do + x=B.cw*(x-1) + gc.line(x,0,x,B.h) + end + for y=0,6 do + y=B.h-B.ch*y-height%B.ch + gc.line(0,y,B.w,y) + end + GC.stc_stop() + gc.translate(-B.x,-B.y) - -- Draw red tile - if diePos then - gc.setColor(1,.2,.2) - gc.rectangle('fill',130+170*diePos+8,600-height+8,170-16,120-16) - end -- Draw score - setFont(100) + setFont(80) gc.push('transform') - gc.translate(640,26) - gc.scale(1.6) + gc.translate(800,40) + gc.scale(2.6) gc.setColor(.5,.5,.5,.6) mStr(score,0,0) gc.pop() end scene.widgetList={ - WIDGET.new{type='button',pos={0,0},x=160,y=100,w=180,h=100,color='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r'}, - modeSelector,colorSelector, + WIDGET.new{type='button',pos={0,0},x=200,y=100,w=180,h=100,color='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r'}, + modeSelector, + colorSelector, arcadeSwitch, WIDGET.new{type='button',pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, } diff --git a/assets/scene/app_link.lua b/assets/scene/app_link.lua index 64ffe27c..1955f34c 100644 --- a/assets/scene/app_link.lua +++ b/assets/scene/app_link.lua @@ -58,8 +58,8 @@ local progress,level local score,score1 local combo,comboTime,maxCombo,noComboBreak local field={ - x=160,y=40, - w=960,h=640, + x=200,y=100, + w=1200,h=800, c=16,r=10, remain=0, } @@ -98,7 +98,7 @@ local function resetBoard() noComboBreak=true comboTime=comboTime+2 - SYSFX.newShade(2,field.x,field.y,field.w,field.h,1,1,1) + SYSFX.new('rect',2,field.x,field.y,field.w,field.h,.8,.8,.8) end local function newGame() state=0 @@ -186,7 +186,7 @@ local function tap(x,y) -- Score local s=1000+floor(combo^.9) score=score+s - TEXT:add("+"..s,1205,600,20,'score') + TEXT:add{text="+"..s,x=1500,y=600,fontSize=20,style='score'} -- Combo if comboTime==0 then @@ -199,12 +199,29 @@ local function tap(x,y) -- Check win if field.remain==0 then + FMOD.effect('frenzy',{volume=.8}) if noComboBreak then - FMOD.effect('emit') - FMOD.effect('clear_4') - TEXT:add("FULL COMBO",640,360,100,'beat',.626) + TEXT:add{text="FULL COMBO",x=800,y=500,fontSize=100,style='beat',styleArg=.626} comboTime=comboTime+3 score=floor(score*1.1) + FMOD.effect( + level==1 and 'clear_2' or + level==2 and 'clear_3' or + level==3 and 'clear_4' or + level==4 and 'clear_5' or + level==5 and 'clear_6' or + level==6 and 'clear_8' or + level==7 and 'clear_10' or + level==8 and 'clear_12' or + level==9 and 'clear_14' or + level==10 and 'clear_16' or + level==11 and 'clear_18' or + level==12 and 'clear_20' or + level==13 and 'clear_21' or + level==14 and 'clear_22' or + level==15 and 'clear_24' or + 'clear_26' + ) end ins(progress, noComboBreak and @@ -214,27 +231,27 @@ local function tap(x,y) level=level+1 if levels[level] then resetBoard() - FMOD.effect('reach') + FMOD.effect('beep_rise') else state=2 FMOD.effect('win') end else FMOD.effect( - combo<50 and 'clear_1' or - combo<100 and 'clear_2' or - 'clear_3',.8 + combo<50 and 'touch' or + combo<100 and 'lock' or + 'drop' ) end selX,selY=false,false else selX,selY=x,y - FMOD.effect('lock',{volume=.9}) + FMOD.effect('move',{volume=.9}) end else if field[y][x] and (x~=selX or y~=selY) then selX,selY=x,y - FMOD.effect('lock',{volume=.8}) + FMOD.effect('move',{volume=.8}) end end end @@ -327,7 +344,7 @@ function scene.draw() -- Selecting box gc.setLineWidth(.1) if selX then - gc_setColor(1,1,1) + gc_setColor(COLOR.L) gc_rectangle('line',selX-1+.05,selY-1+.05,.9,.9) end @@ -338,8 +355,8 @@ function scene.draw() gc.line(lines[i].line) end gc.pop() - -- Frame + -- Frame if state==2 then gc.setColor(.9,.9,0)-- win elseif state==1 then @@ -357,45 +374,45 @@ function scene.draw() end -- Maxcombo - setFont(20) gc.setColor(COLOR.dF) - gc.print(maxCombo,1142,1) + setFont(25) gc.setColor(COLOR.dF) + gc.print(maxCombo,1432,40) -- Time - setFont(30) gc.setColor(COLOR.L) - gc.print(("%.3f"):format(time),1140,20) + setFont(35) gc.setColor(COLOR.L) + gc.print(("%.3f"):format(time),1430,70) - -- Progress time list - setFont(15) gc.setColor(.6,.6,.6) - for i=1,#progress do gc.print(progress[i],1140,40+20*i) end + -- Section times + setFont(20) gc.setColor(.6,.6,.6) + for i=1,#progress do gc.print(progress[i],1430,90+20*i) end -- Combo Rectangle if comboTime>0 then local r=32*comboTime^.3 gc.setColor(1,1,1,min(.6+comboTime,1)*.25) - gc.rectangle('fill',1205-r,440-r,2*r,2*r,2) + gc.rectangle('fill',1500-r,440-r,2*r,2*r,2) gc.setColor(1,1,1,min(.6+comboTime,1)) gc.setLineWidth(2) - gc.rectangle('line',1205-r,440-r,2*r,2*r,4) + gc.rectangle('line',1500-r,440-r,2*r,2*r,4) end -- Combo Text setFont(60) if combo>50 then gc.setColor(1,.2,.2,min(.3+comboTime*.5,1)*min(comboTime,1)) - mStr(combo,1205+(rnd()-.5)*combo^.5,398+(rnd()-.5)*combo^.5) + mStr(combo,1500+(rnd()-.5)*combo^.5,398+(rnd()-.5)*combo^.5) end gc.setColor(1,1,max(1-combo*.001,.5),min(.4+comboTime,1)) - mStr(combo,1205,398) + mStr(combo,1500,398) -- Score setFont(25) gc.setColor(COLOR.L) - mStr(score1,1205,560) + mStr(score1,1500,560) end scene.widgetList={ WIDGET.new{type='button',x=80,y=60,w=110,h=60,color='lG',text=CHAR.icon.retry,code=WIDGET.c_pressKey'r',visibleTick=function() return state~=0 end}, WIDGET.new{type='checkBox',x=100,y=140,widthLimit=80,disp=function() return invis end,code=WIDGET.c_pressKey'q',visibleTick=function() return state~=1 end}, - WIDGET.new{type='button',pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, + WIDGET.new{type='button',pos={1,1},x=-60,y=-60,w=80,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, } return scene diff --git a/assets/scene/app_mahjong.lua b/assets/scene/app_mahjong.lua index 11ed7b97..420f67d5 100644 --- a/assets/scene/app_mahjong.lua +++ b/assets/scene/app_mahjong.lua @@ -73,7 +73,7 @@ end local function _getHandCardArea(i) return - 20+70*i+(i==14 and 30 or 0),480, + 100+70*i+(i==14 and 30 or 0),800, 60,84 end @@ -157,12 +157,13 @@ function scene.keyDown(key,isRep) end function scene.draw() - FONT.set(35) + FONT.set(60) gc_setColor(COLOR.D) - gc_print('余 '..#deck,1060,30) + gc_print('余 '..#deck,1300,60) gc_setLineWidth(4) FONT.set(100) + -- Hand for i=1,#hand do local c=hand[i] local x,y,w,h=_getHandCardArea(i) @@ -179,6 +180,8 @@ function scene.draw() GC.mStr(cardText[c],x+w/2,y-24) if i==selected then gc_translate(0,10) end end + + -- Pool for i=1,#pool do local c=pool[i] local x,y,w,h=_getPoolCardArea(i) @@ -194,8 +197,8 @@ function scene.draw() end scene.widgetList={ - WIDGET.new{type='button',pos={0,0},x=160, y=100,w=180,h=100,color='lR',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r'}, - WIDGET.new{type='button', x=1150,y=370,w=140,h=80,fontSize=45,sound_trigger=false,text='自摸',code=WIDGET.c_pressKey'return'}, - WIDGET.new{type='button',pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, + WIDGET.new{type='button_fill',pos={0,0},x=160, y=100,w=180,h=100,color='lR',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r'}, + WIDGET.new{type='button_fill',pos={1,1},x=-120,y=-180,w=160,h=80,fontSize=45,sound_trigger=false,text='自摸',code=WIDGET.c_pressKey'return'}, + WIDGET.new{type='button_fill',pos={1,1},x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, } return scene diff --git a/assets/scene/app_memorize.lua b/assets/scene/app_memorize.lua index f8537e7b..75246c3d 100644 --- a/assets/scene/app_memorize.lua +++ b/assets/scene/app_memorize.lua @@ -44,18 +44,21 @@ function scene.keyDown(key,isRep) if sureCheck('back') then SCN.back() end elseif key=='r' then _reset() + FMOD.effect('rotate') elseif state==0 then if key:sub(1,2)=="kp" then key=key:sub(3) end if #key==1 and ("0123456789"):find(key,nil,true) then input=input..key + FMOD.effect('inputbox_input') showTime=math.min(showTime,0) if input==showNum then level=level+1 freshLevel() - FMOD.effect('reach') + FMOD.effect('beep_rise') end elseif key=='space' or key=='backspace' then input="" + FMOD.effect('inputbox_bksp') end end return true @@ -70,7 +73,7 @@ function scene.update(dt) if inputTime<=0 then inputTime=0 state=1 - FMOD.effect('finesseError_long',{volume=.6}) + FMOD.effect('fail',{volume=.6}) end end end @@ -78,47 +81,47 @@ end function scene.draw() gc.setColor(COLOR.L) - FONT.set(45) - gc.print(("%.3f"):format(timeUsed),1026,70) + FONT.set(55) + gc.print(("%.3f"):format(timeUsed),1026,100) - FONT.set(35) - GC.mStr("["..level.."]",800,30) + FONT.set(45) + GC.mStr("["..level.."]",800,100) - FONT.set(60) - GC.mStr(input,800,160) + FONT.set(70) + GC.mStr(input,800,240) if state==0 then if showTime<=0 then - FONT.set(30) + FONT.set(40) gc.setColor(1,.7,.7,-3*showTime) - GC.mStr(("%.1f"):format(inputTime),800,230) + GC.mStr(("%.1f"):format(inputTime),800,380) end gc.setColor(1,1,1,showTime/1.26) else gc.setColor(1,.4,.4) end if #showNum<=10 then - FONT.set(100) - GC.mStr(showNum,800,60) + FONT.set(90) + GC.mStr(showNum,800,150) else - FONT.set(60) - GC.mStr(showNum,800,90) + FONT.set(70) + GC.mStr(showNum,800,180) end end scene.widgetList={ - WIDGET.new{type='button',pos={0,0}, x=160,y=100,w=180,h=100,color='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r'}, - WIDGET.new{type='button',pos={0.5,0.95},x=-100,y=-100,w=90,fontSize=60,text=CHAR.key.mac_clear,code=WIDGET.c_pressKey'backspace'}, - WIDGET.new{type='button',pos={0.5,0.95},x=0, y=-100,w=90,fontSize=60,text="0",code=WIDGET.c_pressKey'0'}, - WIDGET.new{type='button',pos={0.5,0.95},x=-100,y=-200,w=90,fontSize=60,text="1",code=WIDGET.c_pressKey'1'}, - WIDGET.new{type='button',pos={0.5,0.95},x=0, y=-200,w=90,fontSize=60,text="2",code=WIDGET.c_pressKey'2'}, - WIDGET.new{type='button',pos={0.5,0.95},x=100, y=-200,w=90,fontSize=60,text="3",code=WIDGET.c_pressKey'3'}, - WIDGET.new{type='button',pos={0.5,0.95},x=-100,y=-300,w=90,fontSize=60,text="4",code=WIDGET.c_pressKey'4'}, - WIDGET.new{type='button',pos={0.5,0.95},x=0, y=-300,w=90,fontSize=60,text="5",code=WIDGET.c_pressKey'5'}, - WIDGET.new{type='button',pos={0.5,0.95},x=100, y=-300,w=90,fontSize=60,text="6",code=WIDGET.c_pressKey'6'}, - WIDGET.new{type='button',pos={0.5,0.95},x=-100,y=-400,w=90,fontSize=60,text="7",code=WIDGET.c_pressKey'7'}, - WIDGET.new{type='button',pos={0.5,0.95},x=0, y=-400,w=90,fontSize=60,text="8",code=WIDGET.c_pressKey'8'}, - WIDGET.new{type='button',pos={0.5,0.95},x=100, y=-400,w=90,fontSize=60,text="9",code=WIDGET.c_pressKey'9'}, + WIDGET.new{type='button',pos={0,0}, x=160,y=100,w=180,h=100,color='lG',fontSize=60,text=CHAR.icon.retry,code=WIDGET.c_pressKey'r',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=-100,y=-100,w=90,fontSize=60,text=CHAR.key.mac_clear,code=WIDGET.c_pressKey'backspace',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=0, y=-100,w=90,fontSize=60,text="0",code=WIDGET.c_pressKey'0',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=-100,y=-200,w=90,fontSize=60,text="1",code=WIDGET.c_pressKey'1',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=0, y=-200,w=90,fontSize=60,text="2",code=WIDGET.c_pressKey'2',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=100, y=-200,w=90,fontSize=60,text="3",code=WIDGET.c_pressKey'3',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=-100,y=-300,w=90,fontSize=60,text="4",code=WIDGET.c_pressKey'4',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=0, y=-300,w=90,fontSize=60,text="5",code=WIDGET.c_pressKey'5',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=100, y=-300,w=90,fontSize=60,text="6",code=WIDGET.c_pressKey'6',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=-100,y=-400,w=90,fontSize=60,text="7",code=WIDGET.c_pressKey'7',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=0, y=-400,w=90,fontSize=60,text="8",code=WIDGET.c_pressKey'8',sound_trigger=false}, + WIDGET.new{type='button',pos={0.5,0.95},x=100, y=-400,w=90,fontSize=60,text="9",code=WIDGET.c_pressKey'9',sound_trigger=false}, WIDGET.new{type='button',pos={1,1}, x=-120,y=-80,w=160,h=80,sound_trigger='button_back',fontSize=60,text=CHAR.icon.back,code=WIDGET.c_backScn()}, } diff --git a/assets/scene/app_piano.lua b/assets/scene/app_piano.lua index f0b19afb..2f19247e 100644 --- a/assets/scene/app_piano.lua +++ b/assets/scene/app_piano.lua @@ -3,9 +3,11 @@ local kb=love.keyboard local instList={'square_wave','triangle_wave','sine_wave'} local keys={ - ['1']=57,['2']=59,['3']=61,['4']=62,['5']=64,['6']=66,['7']=68,['8']=69,['9']=71,['0']=73,['-']=74,['=']=76,['backspace']=78, - ['q']=45,['w']=47,['e']=49,['r']=50,['t']=52,['y']=54,['u']=56,['i']=57,['o']=59,['p']=61,['[']=62,[']']=64,['\\']=66, - ['a']=33,['s']=35,['d']=37,['f']=38,['g']=40,['h']=42,['j']=44,['k']=45,['l']=47,[';']=49,["'"]=50,['return']=52, + -- ['1']=57,['2']=59,['3']=61,['4']=62,['5']=64,['6']=66,['7']=68,['8']=69,['9']=71,['0']=73,['-']=74,['=']=76,['backspace']=78, + ['2']=34,['3']=36, ['5']=39,['6']=41,['7']=43, ['9']=46,['0']=48, ['=']=51,['backspace']=53, + ['q']=33,['w']=35,['e']=37,['r']=38,['t']=40,['y']=42,['u']=44,['i']=45,['o']=47,['p']=49,['[']=50,[']']=52,['\\']=54, + -- ['a']=33,['s']=35,['d']=37,['f']=38,['g']=40,['h']=42,['j']=44,['k']=45,['l']=47,[';']=49,["'"]=50,['return']=52, + ['s']=22,['d']=24, ['g']=27,['h']=29,['j']=31, ['l']=34,[';']=36, ['z']=21,['x']=23,['c']=25,['v']=26,['b']=28,['n']=30,['m']=32,[',']=33,['.']=35,['/']=37, } local activeEventMap={} @@ -50,7 +52,7 @@ function scene.keyDown(key,isRep) elseif key=='ralt' then offset=math.min(offset+1,12) elseif key=='escape' then - SCN.back() + if sureCheck('back') then SCN.back() end end return true end diff --git a/assets/scene/app_polyforge.lua b/assets/scene/app_polyforge.lua index 3ff8ea9d..3bd2db59 100644 --- a/assets/scene/app_polyforge.lua +++ b/assets/scene/app_polyforge.lua @@ -1,11 +1,10 @@ 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 zooming local ang,pos local hit,dist local side,count @@ -21,7 +20,7 @@ local function new() count=0 for c=1,side do hit[c]=0 - dist[c]=rnd(80,270)+637.5 + dist[c]=rnd(200,360) end end @@ -31,7 +30,7 @@ local scene={} function scene.enter() state=0 ang,pos=0,-tau/4 - timer=50 + zooming=50 hit,dist={},{} side=rnd(3,6)*2 needReset=true @@ -48,7 +47,7 @@ function scene.keyDown(key,isRep) if sureCheck('back') then SCN.back() end elseif key=='space' then if state==0 then -- main - if timer==0 then + if zooming<=0 then state=1 end elseif state==3 then -- play @@ -56,19 +55,16 @@ function scene.keyDown(key,isRep) if hit[c]==0 then hit[c]=1 count=count+1 - FMOD.effect(side<26 and 'ren_'..rnd(5) or 'ren_'..rnd(6,11)) - if count>=12 then - FMOD.effect('ren_mega',{volume=(count-11)/15}) - end + comboSound(count+5) if count==side then state=1 FMOD.effect('spin_0') else - FMOD.effect('lock') + FMOD.effect('touch') end else hit[c]=2 - FMOD.effect('emit') + FMOD.effect('fail',{volume=.6}) needReset=true state=1 end @@ -85,81 +81,72 @@ function scene.touchDown() scene.keyDown('space') end -function scene.update() +function scene.update(dt) if state==0 then -- main ang=ang-.02 if ang>0 then ang=ang-tau end if pos0 then timer=timer-1 end + if zooming>0 then zooming=math.max(zooming-dt*60,0) end elseif state==1 or state==2 then -- zoom - ang=ang+.02+timer/260 - pos=pos-.016 + ang=ang+.02*dt*60+zooming/260 + pos=pos-.016*dt*60 if ang>0 then ang=ang-tau end if pos0 then - ang=ang-tau - end - if pos0 then ang=ang-tau end + if pos640 and p1 or p2 P.score=P.score+1 TEXT:add("+1",P==p1 and 470 or 810,226,50,'score') - FMOD.effect('reach') + FMOD.effect('beep_rise') state=0 bx,by=640,360 diff --git a/assets/scene/app_schulteG.lua b/assets/scene/app_schulteG.lua index df581d49..31a80666 100644 --- a/assets/scene/app_schulteG.lua +++ b/assets/scene/app_schulteG.lua @@ -55,7 +55,7 @@ local function tapBoard(x,y) else time=love.timer.getTime()-startTime+mistake state=2 - FMOD.effect('reach') + FMOD.effect('beep_rise') end if tapFX then SYSFX.newShade(3,320+640/R*X,40+640/R*Y,640/R,640/R,.6,.8,1) @@ -65,7 +65,7 @@ local function tapBoard(x,y) if tapFX then SYSFX.newShade(2,320+640/R*X,40+640/R*Y,640/R,640/R,1,.4,.5) end - FMOD.effect('finesseError') + FMOD.effect('rotate_failed') end end end @@ -106,7 +106,7 @@ function scene.keyDown(key,isRep) rank=tonumber(key) end elseif key=='escape' then - SCN.back() + if sureCheck('back') then SCN.back() end end return true end diff --git a/assets/scene/app_stopwatch.lua b/assets/scene/app_stopwatch.lua index 2ebfb65d..3f8e6e97 100644 --- a/assets/scene/app_stopwatch.lua +++ b/assets/scene/app_stopwatch.lua @@ -40,14 +40,14 @@ function scene.touchDown() press() end function scene.touchUp() - if #love.touch.getTouches()==0 then + if #getTouches()==0 then release() end end function scene.keyDown(key,isRep) if isRep then return true end if key=='escape' then - SCN.back() + if sureCheck('back') then SCN.back() end else press() end diff --git a/assets/scene/app_tap.lua b/assets/scene/app_tap.lua index ec387183..c98e3c64 100644 --- a/assets/scene/app_tap.lua +++ b/assets/scene/app_tap.lua @@ -20,7 +20,7 @@ end function scene.keyDown(key,isRep) if isRep then return true end if key=='escape' then - SCN.back() + if sureCheck('back') then SCN.back() end else if lastKey~=key then lastKey=key diff --git a/assets/scene/app_ten.lua b/assets/scene/app_ten.lua index 185820f8..8a5cb2b6 100644 --- a/assets/scene/app_ten.lua +++ b/assets/scene/app_ten.lua @@ -1,6 +1,5 @@ local gc=love.graphics -local msIsDown,kbIsDown,tcTouches=love.mouse.isDown,love.keyboard.isDown,love.touch.getTouches -local setColor,rectangle=gc.setColor,gc.rectangle +local gc_setColor,gc_rectangle=gc.setColor,gc.rectangle local floor,rnd=math.floor,math.random local ins,rem=table.insert,table.remove @@ -53,7 +52,7 @@ local function reset() failPos=false end function scene.enter() - BG.set('rainbow2') + BG.set('space') preview={} board={{},{},{},{},{}} cx,cy=3,3 @@ -102,7 +101,7 @@ local function merge() maxTile<=8 and 3 or maxTile<=11 and 4 or 5 - FMOD.effect('reach') + FMOD.effect('beep_rise') end if chosen>=5 then FMOD.effect( @@ -211,9 +210,9 @@ function scene.update() end end elseif fast and ( - msIsDown(1) or - #tcTouches()>0 or - kbIsDown('space') + isMouseDown(1) or + #getTouches()>0 or + isKeyDown('space') ) then merge() end @@ -222,13 +221,13 @@ end function scene.draw() setFont(40) - setColor(1,1,1) + gc_setColor(COLOR.L) gc.print(("%.3f"):format(time),1026,50) gc.print(score,1026,100) -- Progress time list setFont(25) - setColor(.7,.7,.7) + gc_setColor(.7,.7,.7) for i=1,#progress do gc.print(progress[i],1000,140+30*i) end @@ -236,10 +235,10 @@ function scene.draw() -- Previews if nexts then gc.setColor(COLOR.dX) - rectangle('fill',20,450,280,75) + gc_rectangle('fill',20,450,280,75) gc.setLineWidth(6) - setColor(1,1,1) - rectangle('line',20,450,280,75) + gc_setColor(COLOR.L) + gc_rectangle('line',20,450,280,75) for i=1,5 do setFont(85-10*i) gc.setColor(tileColor[preview[i]]) @@ -249,16 +248,16 @@ function scene.draw() if state==2 then -- Draw no-setting area - setColor(1,0,0,.3) - rectangle('fill',15,200,285,210) + gc_setColor(1,0,0,.3) + gc_rectangle('fill',15,200,285,210) end gc.setLineWidth(10) - setColor(COLOR[ + gc_setColor(COLOR[ state==1 and (fast and 'R' or 'W') or state==0 and 'G' or state==2 and 'Y' ]) - rectangle('line',315,35,650,650) + gc_rectangle('line',315,35,650,650) gc.setLineWidth(4) setFont(70) @@ -267,31 +266,31 @@ function scene.draw() local N=board[i][j] if N>0 then if hide and N>maxNew then - setColor(COLOR.lD) - rectangle('fill',320+j*128-128,40+i*128-128,128,128) - setColor(1,1,1,.3) + gc_setColor(COLOR.lD) + gc_rectangle('fill',320+j*128-128,40+i*128-128,128,128) + gc_setColor(1,1,1,.3) mStr("?",j*128+256,i*128-75) else if N<=12 then - setColor(tileColor[N]) + gc_setColor(tileColor[N]) elseif N<=14 then - setColor(COLOR.rainbow(4*love.timer.getTime()-i-j)) + gc_setColor(COLOR.rainbow(4*love.timer.getTime()-i-j)) else - setColor(0,0,0,1-math.abs(love.timer.getTime()%.5-.25)*6-.25) + gc_setColor(0,0,0,1-math.abs(love.timer.getTime()%.5-.25)*6-.25) end - rectangle('fill',320+j*128-128,40+i*128-128,128,128) - setColor(1,1,1,.9) + gc_rectangle('fill',320+j*128-128,40+i*128-128,128,128) + gc_setColor(1,1,1,.9) mStr(N,j*128+256,i*128-75) end end end end if state<2 and cx then - setColor(1,1,1,.6) + gc_setColor(1,1,1,.6) gc.setLineWidth(10) - rectangle('line',325+cx*128-128,45+cy*128-128,118,118) + gc_rectangle('line',325+cx*128-128,45+cy*128-128,118,118) end setFont(50) - setColor(1,1,1) + gc_setColor(COLOR.L) mStr("Just Get Ten",160,580) end diff --git a/assets/scene/app_triple.lua b/assets/scene/app_triple.lua index c6fe978f..0f4d5d57 100644 --- a/assets/scene/app_triple.lua +++ b/assets/scene/app_triple.lua @@ -1,5 +1,5 @@ local gc=love.graphics -local setColor,rectangle=gc.setColor,gc.rectangle +local gc_setColor,gc_rectangle=gc.setColor,gc.rectangle local floor,rnd=math.floor,math.random local ins,rem=table.insert,table.remove @@ -168,7 +168,7 @@ function player:click(y,x) if self.maxTile>=6 then ins(self.progress,("%s - %.3fs"):format(self.maxTile,love.timer.getTime()-player.startTime)) end - FMOD.effect('reach') + FMOD.effect('beep_rise') end local getScore=4^cur*count @@ -212,9 +212,9 @@ end local function drawTile(x,y,v) if v and v~=0 then - setColor(tileColor[v]) - rectangle('fill',x*100-100,y*100-100,100,100) - setColor(textColor[v]) + gc_setColor(tileColor[v]) + gc_rectangle('fill',x*100-100,y*100-100,100,100) + gc_setColor(textColor[v]) mStr(tileTexts[v],x*100-50,y*100-92) end end @@ -223,16 +223,16 @@ function player:drawBoard() gc.translate(self.x,self.y) -- Board background - setColor(COLOR.dX) - rectangle('fill',0,0,600,600) + gc_setColor(COLOR.dX) + gc_rectangle('fill',0,0,600,600) -- Hold slot - setColor(0,1,1,.4) - rectangle('fill',0,0,100,100) + gc_setColor(0,1,1,.4) + gc_rectangle('fill',0,0,100,100) gc.setLineWidth(10) - setColor(COLOR.lC) - rectangle('line',5,5,90,90) + gc_setColor(COLOR.lC) + gc_rectangle('line',5,5,90,90) -- Hold tile setFont(60) @@ -245,18 +245,18 @@ function player:drawBoard() end end -- Board lines - setColor(COLOR.L) + gc_setColor(COLOR.L) gc.setLineWidth(2) for x=1,5 do gc.line(x*100,0,x*100,600) end for y=1,5 do gc.line(0,y*100,600,y*100) end gc.setLineWidth(6) - rectangle('line',0,0,600,600) + gc_rectangle('line',0,0,600,600) -- Select box if self.selectX then local c=tileColor[self.nexts[1]] - setColor(c[1],c[2],c[3],.6+.3*math.sin(love.timer.getTime()*9.29)) - rectangle('line',self.selectX*100-95,self.selectY*100-95,90,90) + gc_setColor(c[1],c[2],c[3],.6+.3*math.sin(love.timer.getTime()*9.29)) + gc_rectangle('line',self.selectX*100-95,self.selectY*100-95,90,90) end gc.pop() @@ -320,27 +320,27 @@ end function scene.draw() setFont(40) - setColor(1,1,1) + gc_setColor(1,1,1) gc.print(("%.3f"):format(player.time),1026,50) gc.print(player.score,1026,100) -- Progress time list setFont(25) - setColor(.7,.7,.7) + gc_setColor(.7,.7,.7) for i=1,#player.progress do gc.print(player.progress[i],1000,140+30*i) end gc.push('transform') gc.translate(745,13) - setColor(COLOR.L) + gc_setColor(COLOR.L) gc.setLineWidth(4) gc.rectangle('line',-5,-5,200,70) for i=1,3 do - setColor(tileColor[player.nexts[i]]) - rectangle('fill',65*i-65,0,60,60) + gc_setColor(tileColor[player.nexts[i]]) + gc_rectangle('fill',65*i-65,0,60,60) setFont(40) - setColor(textColor[player.nexts[i]]) + gc_setColor(textColor[player.nexts[i]]) mStr(player.nexts[i],65*i-35,0) end gc.pop() diff --git a/main.lua b/main.lua index ac1ccac8..64621b2e 100644 --- a/main.lua +++ b/main.lua @@ -144,6 +144,7 @@ WIDGET.setDefaultOption{ soundPitchRange=7.02, }, checkBox={ + w=40, sound_on='check_on', sound_off='check_off', }, @@ -214,27 +215,6 @@ IMG.init{ }, title_techmino='assets/image/title_techmino.png', logo_fmod='assets/image/logo_fmod.png', - -- touhou=(function() - -- local path='assets/image/touhou/' - -- local L={} - -- for _,v in next,love.filesystem.getDirectoryItems(path) do - -- if FILE.isSafe(path..v) then - -- L[tonumber(v:match("%d+"))]=path..v - -- end - -- end - -- return L - -- end)(), - touhou={ - ball='assets/image/touhou/ball.png', - reimu='assets/image/touhou/001.png', - marisa='assets/image/touhou/002.png', - }, - heart={ - 'assets/image/heart/1.png', - 'assets/image/heart/2.png', - 'assets/image/heart/3.png', - 'assets/image/heart/4.png', - }, } Text=nil---@type Techmino.I18N @@ -279,6 +259,9 @@ function FMODLoadFunc() -- Will be called again when applying advanced options end end end + -- print("--------------------------") + -- print("Musics") + -- for k,v in next,L do print(k,v)end return L end)()) FMOD.registerEffect((function() @@ -300,6 +283,9 @@ function FMODLoadFunc() -- Will be called again when applying advanced options L[name]=path end end + -- print("--------------------------") + -- print("Effects") + -- for k,v in next,L do print(k,v)end return L end)()) end