合并load和intro场景

This commit is contained in:
MrZ626
2021-07-19 15:34:28 +08:00
parent ed2a46e059
commit defe6c4f26
11 changed files with 68 additions and 99 deletions

View File

@@ -10,9 +10,8 @@ return{
loadModeIcon="Loading mode icons",
loadMode="Loading modes",
loadOther="Loading other assets",
finish="Loading complete",
finish="Loading complete, any key to start",
},
anykey="Press a key!",
sureQuit="Press again to exit",
newDay="A new day, a new beginning!",
playedLong="You have been playing for a long time. Make sure to rest well!",

View File

@@ -1,6 +1,5 @@
return{
fallback=4,
anykey="Pulsa cualquier tecla",
sureQuit="Pulsa de nuevo para salir",
newDay="[Anti-adicción] ¡Nuevo día, nuevo comienzo!",
playedLong="[Anti-adicción] Estuviste jugando un buen rato hoy. Recuerda descansar de vez en cuando.",

View File

@@ -1,6 +1,5 @@
return{
fallback=4,
anykey="Appuyez sur n'importe quelle touche",
sureQuit="Appuyez à nouveau pour sortir",
newDay="[Anti-addiction] Nouveau jour, nouveau commencement !",
playedLong="[Anti-addiction] Vous avez joué pendant un bon bout de temps aujourd'hui. Faites des pauses.",

View File

@@ -1,7 +1,6 @@
local C=COLOR
return{
fallback=4,
anykey="Pressione qualquer tecla",
sureQuit="Aparte novamente para sair",
newDay="[Anti-vício] Novo dia, um começo novo!",
playedLong="[Anti-vício] Você andou jogando bastante hoje. Certifique-se de fazer pausas.",

View File

@@ -1,6 +1,5 @@
return{
fallback=4,
anykey="↓□↓",
atkModeName={"?","( )","!","←→"},
royale_remain="$1 ~",

View File

@@ -1,5 +1,4 @@
return{
anykey="您开始了",
playedLong="今天玩很久了,给我注意点",
playedTooMuch="特么再玩小心眼睛瞎掉,爬",

View File

@@ -10,9 +10,8 @@ return{
loadModeIcon="加载模式图标",
loadMode="加载模式",
loadOther="加载杂项",
finish="加载完成",
finish="加载完成,按任意键继续",
},
anykey="按任意键继续",
sureQuit="再按一次退出",
newDay="新的一天,新的开始~",
playedLong="已经玩很久了!注意休息!",

View File

@@ -159,7 +159,6 @@ do--drawableText
drawableText={
modeName=T(30),
anykey=T(40),
win=T(120),lose=T(120),
finish=T(120),
gamewin=T(100),gameover=T(100),pause=T(120),

View File

@@ -1,77 +0,0 @@
local gc=love.graphics
local max,min,sin,cos=math.max,math.min,math.sin,math.cos
local rnd=math.random
local scene={}
local t1,t2,animeType
function scene.sceneInit()
BG.set()
t1,t2=0,0--Timer
animeType={}for i=1,8 do animeType[i]=rnd(5)end--Random animation type
end
function scene.mouseDown()
SCN.go(SETTING.simpMode and'main_simple'or'main')
end
function scene.touchDown()
scene.mouseDown()
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=="escape"then
VOC.play('bye')
SCN.swapTo('quit','slowFade')
else
scene.mouseDown()
end
end
function scene.update()
t1,t2=t1+1,t2+1
end
local titleTransform={
function(t)gc.translate(0,max(50-t,0)^2/25)end,
function(t)gc.translate(0,-max(50-t,0)^2/25)end,
function(t,i)local d=max(50-t,0)gc.translate(sin(TIME()*3+626*i)*d,cos(TIME()*3+626*i)*d)end,
function(t,i)local d=max(50-t,0)gc.translate(sin(TIME()*3+626*i)*d,-cos(TIME()*3+626*i)*d)end,
function(t)gc.setColor(1,1,1,min(t*.02,1)+rnd()*.2)end,
}
local titleColor={COLOR.lP,COLOR.lC,COLOR.lB,COLOR.lO,COLOR.lF,COLOR.lM,COLOR.lG,COLOR.lY}
function scene.draw()
local T=(t1+110)%300
if T<30 then
gc.setLineWidth(4+(30-T)^1.626/62)
else
gc.setLineWidth(4)
end
local L=title
gc.push('transform')
gc.translate(126,226)
for i=1,8 do
local t=t1-i*15
if t>0 then
gc.push('transform')
titleTransform[animeType[i]](t,i)
local dt=(t1+62-5*i)%300
if dt<20 then
gc.translate(0,math.abs(10-dt)-10)
end
gc.setColor(titleColor[i][1],titleColor[i][2],titleColor[i][3],min(t*.025,1)*.26)
gc.polygon('fill',L[i])
gc.setColor(1,1,1,min(t*.025,1))
gc.polygon('line',L[i])
gc.pop()
end
end
gc.pop()
if t2>=80 then
gc.setColor(1,1,1,.6+sin((t2-80)*.0626)*.3)
mText(drawableText.anykey,640,615+sin(TIME()*3)*5)
end
end
return scene

View File

@@ -1,8 +1,12 @@
local gc=love.graphics
local max,min,sin,cos=math.max,math.min,math.sin,math.cos
local rnd=math.random
local scene={}
local loading,progress,maxProgress,waitTime
local loading,progress,maxProgress
local t1,t2,animeType
local studioLogo--Studio logo text object
local logoColor1,logoColor2
@@ -138,33 +142,75 @@ end)
function scene.sceneInit()
studioLogo=gc.newText(getFont(90),"26F Studio")
waitTime=0
progress=0
maxProgress=10
t1,t2=0,0--Timer
animeType={}for i=1,8 do animeType[i]=rnd(5)end--Random animation type
end
function scene.sceneBack()
love.event.quit()
end
function scene.update(dt)
function scene.mouseDown()
if LOADED then
SCN.swapTo(SETTING.simpMode and'main_simple'or'main')
end
end
scene.touchDown=scene.mouseDown
function scene.keyDown(key)
if key=="escape"then
love.event.quit()
elseif LOADED then
scene.mouseDown()
end
end
function scene.update()
if not LOADED then
loading=loadingThread()or loading
progress=progress+1
else
waitTime=waitTime+dt
if waitTime>1 then
SCN.swapTo('intro')
end
t1,t2=t1+1,t2+1
end
end
local titleTransform={
function(t)gc.translate(0,max(50-t,0)^2/25)end,
function(t)gc.translate(0,-max(50-t,0)^2/25)end,
function(t,i)local d=max(50-t,0)gc.translate(sin(TIME()*3+626*i)*d,cos(TIME()*3+626*i)*d)end,
function(t,i)local d=max(50-t,0)gc.translate(sin(TIME()*3+626*i)*d,-cos(TIME()*3+626*i)*d)end,
function(t)gc.setColor(1,1,1,min(t*.02,1)+rnd()*.2)end,
}
local titleColor={COLOR.lP,COLOR.lC,COLOR.lB,COLOR.lO,COLOR.lF,COLOR.lM,COLOR.lG,COLOR.lY}
function scene.draw()
gc.clear(.1,.1,.1)
gc.setColor(1,1,1,progress/maxProgress)
mDraw(TEXTURE.title,640,240,0,.9)
gc.setColor(1,1,1,waitTime/.626)
mDraw(TEXTURE.title_color,640,240,0,.9)
local T=(t1+110)%300
if T<30 then
gc.setLineWidth(4+(30-T)^1.626/62)
else
gc.setLineWidth(4)
end
local L=title
gc.push('transform')
gc.translate(126,100)
for i=1,8 do
local t=t1-i*15
if t>0 then
gc.push('transform')
titleTransform[animeType[i]](t,i)
local dt=(t1+62-5*i)%300
if dt<20 then
gc.translate(0,math.abs(10-dt)-10)
end
gc.setColor(titleColor[i][1],titleColor[i][2],titleColor[i][3],min(t*.025,1)*.26)
gc.polygon('fill',L[i])
gc.setColor(1,1,1,min(t*.025,1))
gc.polygon('line',L[i])
gc.pop()
end
end
gc.pop()
gc.setColor(logoColor1[1],logoColor1[2],logoColor1[3],progress/maxProgress)mDraw(studioLogo,640,400)
gc.setColor(logoColor2[1],logoColor2[2],logoColor2[3],progress/maxProgress)for dx=-2,2,2 do for dy=-2,2,2 do mDraw(studioLogo,640+dx,400+dy)end end

View File

@@ -2,6 +2,7 @@ local gc=love.graphics
local scene={}
local lastQuitTime
local verName=("%s %s %s"):format(SYSTEM,VERSION.string,VERSION.name)
local tipLength=760
local tip=gc.newText(getFont(30),"")
@@ -23,6 +24,7 @@ local enterConsole=coroutine.wrap(function()
end)
function scene.sceneInit()
BG.set()
lastQuitTime=-1e99
--Set tip
tip:set(text.getTip())
@@ -115,7 +117,13 @@ function scene.keyDown(key,isRep)
elseif key=="c"then
enterConsole()
elseif key=="escape"then
SCN.back()
if TIME()-lastQuitTime<1 then
VOC.play('bye')
SCN.swapTo('quit','slowFade')
else
lastQuitTime=TIME()
MES.new('warn',text.sureQuit)
end
end
end