更改场景内更新和绘制的方法名
This commit is contained in:
@@ -479,7 +479,7 @@ function love.run()
|
||||
BG.update(dt)
|
||||
SYSFX.update(dt)
|
||||
TEXT.update()
|
||||
if SCN.Tmr then SCN.Tmr(dt)end--Scene Updater
|
||||
if SCN.update then SCN.update(dt)end--Scene Updater
|
||||
if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation
|
||||
WIDGET.update()--Widgets animation
|
||||
LOG.update()
|
||||
@@ -497,7 +497,7 @@ function love.run()
|
||||
gc.replaceTransform(xOy)
|
||||
|
||||
--Draw scene contents
|
||||
if SCN.Pnt then SCN.Pnt()end
|
||||
if SCN.draw then SCN.draw()end
|
||||
|
||||
--Draw widgets
|
||||
WIDGET.draw()
|
||||
|
||||
@@ -18,8 +18,8 @@ local SCN={
|
||||
seq={"quit","slowFade"},--Back sequence
|
||||
|
||||
--Events
|
||||
Tmr=nil,
|
||||
Pnt=nil,
|
||||
update=nil,
|
||||
draw=nil,
|
||||
mouseClick=nil,
|
||||
touchClick=nil,
|
||||
mouseDown=nil,
|
||||
@@ -57,8 +57,8 @@ function SCN.init(s,org)
|
||||
local S=scenes[s]
|
||||
SCN.sceneInit=S.sceneInit
|
||||
SCN.sceneBack=S.sceneBack
|
||||
SCN.Tmr=S.Tmr
|
||||
SCN.Pnt=S.Pnt
|
||||
SCN.update=S.update
|
||||
SCN.draw=S.draw
|
||||
SCN.mouseClick=S.mouseClick
|
||||
SCN.touchClick=S.touchClick
|
||||
SCN.mouseDown=S.mouseDown
|
||||
|
||||
@@ -114,7 +114,7 @@ function scene.keyDown(k)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
gc.setColor(1,1,1)
|
||||
gc.setLineWidth(4)
|
||||
|
||||
@@ -104,7 +104,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
--Field content
|
||||
if sceneTemp.initField then
|
||||
gc.push("transform")
|
||||
|
||||
@@ -152,11 +152,11 @@ function scene.keyDown(key)
|
||||
S.x,S.y,S.pen=sx,sy,pen
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
local sx,sy=S.x,S.y
|
||||
|
||||
|
||||
@@ -113,11 +113,11 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
|
||||
--Draw frame
|
||||
|
||||
@@ -111,11 +111,11 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
|
||||
--Draw frame
|
||||
|
||||
@@ -103,7 +103,7 @@ function scene.keyDown(key)
|
||||
S.url=(S.result[1]and S.result or S.dict)[S.select][5]
|
||||
end
|
||||
|
||||
function scene.Tmr(dt)
|
||||
function scene.update(dt)
|
||||
local S=sceneTemp
|
||||
if S.waiting>0 then
|
||||
S.waiting=S.waiting-dt
|
||||
@@ -123,7 +123,7 @@ local typeColor={
|
||||
english=COLOR.green,
|
||||
name=COLOR.lPurple,
|
||||
}
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
|
||||
gc.setLineWidth(4)
|
||||
|
||||
@@ -9,7 +9,7 @@ function scene.sceneInit()
|
||||
BG.set("space")
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
setFont(20)
|
||||
gc.setColor(1,1,1)
|
||||
for i=1,#text.help do
|
||||
|
||||
@@ -47,7 +47,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
gc.setColor(.2,.2,.2,.7)
|
||||
gc.rectangle("fill",30,45,1000,632)
|
||||
gc.setColor(1,1,1)
|
||||
|
||||
@@ -48,7 +48,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
local S=sceneTemp
|
||||
S.t1=S.t1+1
|
||||
S.t2=S.t2+1
|
||||
@@ -73,7 +73,7 @@ local titleTransform={
|
||||
gc.setColor(1,1,1,min(t*.02,1)+rnd()*.2)
|
||||
end,
|
||||
}
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
local T=(S.t1+110)%300
|
||||
if T<30 then
|
||||
|
||||
@@ -49,7 +49,7 @@ function scene.touchDown()
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
local S=sceneTemp
|
||||
if S.time==400 then return end
|
||||
repeat
|
||||
@@ -148,7 +148,7 @@ function scene.Tmr()
|
||||
until not S.skip
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
|
||||
gc.push("transform")
|
||||
|
||||
@@ -16,12 +16,12 @@ function scene.sceneInit()
|
||||
PLY.newDemoPlayer(1,900,35,1.1)
|
||||
end
|
||||
|
||||
function scene.Tmr(dt)
|
||||
function scene.update(dt)
|
||||
GAME.frame=GAME.frame+1
|
||||
PLAYERS[1]:update(dt)
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
gc.setColor(1,1,1)
|
||||
gc.draw(IMG.title_color,60,30,nil,1.3)
|
||||
setFont(30)
|
||||
|
||||
@@ -192,7 +192,7 @@ function scene.touchMove(_,x,y)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
local S=sceneTemp
|
||||
if S.state==1 then
|
||||
S.time=Timer()-S.startTime
|
||||
@@ -263,7 +263,7 @@ local backColor={
|
||||
COLOR.black,COLOR.black,COLOR.black,COLOR.black,
|
||||
},--Black
|
||||
}
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
|
||||
setFont(40)
|
||||
|
||||
@@ -78,7 +78,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
local S=sceneTemp
|
||||
if S.state==1 then
|
||||
S.frameKeyCount=0
|
||||
@@ -86,7 +86,7 @@ function scene.Tmr()
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
|
||||
setFont(40)
|
||||
|
||||
@@ -101,7 +101,7 @@ function scene.sceneInit()
|
||||
BG.set("bg2")
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
gc.push("transform")
|
||||
--origin pos:0,140; scale:4
|
||||
gc.translate(280,0)
|
||||
|
||||
@@ -126,7 +126,7 @@ function scene.keyUp(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr(dt)
|
||||
function scene.update(dt)
|
||||
dt=dt*600
|
||||
|
||||
--Update cubes' position
|
||||
@@ -189,7 +189,7 @@ function scene.Tmr(dt)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
--Health bar
|
||||
if life1>0 then
|
||||
gc.setColor(1,0,0)
|
||||
|
||||
@@ -71,7 +71,7 @@ function scene.mouseMove(x,y)
|
||||
end
|
||||
|
||||
--Rect Area X:150~1130 Y:20~700
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
local S=sceneTemp
|
||||
|
||||
--Update pads
|
||||
@@ -148,7 +148,7 @@ function scene.Tmr()
|
||||
S.x,S.y,S.vx,S.vy,S.ry=x,y,vx,vy,ry
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
|
||||
--Draw score
|
||||
|
||||
@@ -114,14 +114,14 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
local S=sceneTemp
|
||||
if S.state==1 then
|
||||
S.time=Timer()-S.startTime+S.error
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
|
||||
setFont(40)
|
||||
|
||||
@@ -93,7 +93,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
for _,M in next,MODOPT do
|
||||
if M.sel==0 then
|
||||
if M.time>0 then
|
||||
@@ -106,7 +106,7 @@ function scene.Tmr()
|
||||
end
|
||||
end
|
||||
end
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
setFont(40)
|
||||
gc.setLineWidth(5)
|
||||
for _,M in next,MODOPT do
|
||||
|
||||
@@ -133,7 +133,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
local dx,dy=0,0
|
||||
local F
|
||||
if not SCN.swapping then
|
||||
@@ -187,7 +187,7 @@ function scene.Tmr()
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local _
|
||||
gc.push("transform")
|
||||
gc.translate(640,360)
|
||||
|
||||
@@ -66,7 +66,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
gc.setColor(1,1,1)
|
||||
|
||||
setFont(50)
|
||||
|
||||
@@ -143,7 +143,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr(dt)
|
||||
function scene.update(dt)
|
||||
if not GAME.result then
|
||||
GAME.pauseTime=GAME.pauseTime+dt
|
||||
end
|
||||
@@ -156,10 +156,10 @@ local hexList={1,0,.5,1.732*.5,-.5,1.732*.5}
|
||||
for i=1,6 do hexList[i]=hexList[i]*150 end
|
||||
local textPos={90,131,-90,131,-200,-25,-90,-181,90,-181,200,-25}
|
||||
local dataPos={90,143,-90,143,-200,-13,-90,-169,90,-169,200,-13}
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
local T=S.timer*.02
|
||||
if T<1 or GAME.result then SCN.scenes.play.Pnt()end
|
||||
if T<1 or GAME.result then SCN.scenes.play.draw()end
|
||||
|
||||
--Dark BG
|
||||
local _=T
|
||||
|
||||
@@ -145,7 +145,7 @@ function scene.gamepadUp(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr(dt)
|
||||
function scene.update(dt)
|
||||
local _
|
||||
local P1=PLAYERS[1]
|
||||
local GAME=GAME
|
||||
@@ -294,7 +294,7 @@ local function drawVirtualkey()
|
||||
end
|
||||
end
|
||||
end
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
if MARKING then
|
||||
setFont(25)
|
||||
local t=Timer()
|
||||
|
||||
@@ -14,7 +14,7 @@ function scene.sceneInit()
|
||||
BG.set("bg1")
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
local T=sceneTemp
|
||||
if T.wait>0 then
|
||||
T.wait=T.wait-1
|
||||
@@ -54,7 +54,7 @@ function scene.Tmr()
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
--Testing grid line
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(1,1,1,.4)
|
||||
|
||||
@@ -12,7 +12,7 @@ function scene.sceneBack()
|
||||
FILE.save(SETTING,"settings")
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
gc.setColor(1,1,1)
|
||||
gc.draw(SKIN.curText[int(Timer()*2)%16+1],740,540,Timer()%6.28319,2,nil,15,15)
|
||||
end
|
||||
|
||||
@@ -91,7 +91,7 @@ function scene.gamepadDown(key)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local S=sceneTemp
|
||||
local a=.3+sin(Timer()*15)*.1
|
||||
if S.kS then gc.setColor(1,.3,.3,a)else gc.setColor(1,.7,.7,a)end
|
||||
|
||||
@@ -4,7 +4,7 @@ local sin=math.sin
|
||||
|
||||
local scene={}
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
gc.setColor(1,1,1)
|
||||
local texture=SKIN.curText
|
||||
for N=1,7 do
|
||||
|
||||
@@ -33,14 +33,14 @@ function scene.touchDown(_,x,y)
|
||||
scene.mouseDown(x,y)
|
||||
end
|
||||
|
||||
function scene.Tmr()
|
||||
function scene.update()
|
||||
local t=sceneTemp.jump
|
||||
if t>0 then
|
||||
sceneTemp.jump=t-1
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
gc.setColor(1,1,1)
|
||||
local t=Timer()
|
||||
local _=sceneTemp.jump
|
||||
|
||||
@@ -81,7 +81,7 @@ local function VirtualkeyPreview()
|
||||
end
|
||||
end
|
||||
end
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
gc.setColor(1,1,1)
|
||||
gc.setLineWidth(7)gc.rectangle("line",340,15,600,690)
|
||||
gc.setLineWidth(3)gc.rectangle("line",490,85,300,600)
|
||||
|
||||
@@ -2,7 +2,7 @@ local gc=love.graphics
|
||||
|
||||
local scene={}
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
gc.setColor(1,1,1)
|
||||
mText(drawableText.VKTchW,140+50*SETTING.VKTchW,260)
|
||||
mText(drawableText.VKOrgW,140+50*SETTING.VKTchW+50*SETTING.VKCurW,320)
|
||||
|
||||
@@ -39,7 +39,7 @@ function scene.keyDown(k)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Tmr(dt)
|
||||
function scene.update(dt)
|
||||
local S=sceneTemp
|
||||
if(kb.isDown("space","return")or tc.getTouches()[1])and S.v<6.26 then
|
||||
S.v=S.v+.26
|
||||
@@ -52,7 +52,7 @@ function scene.Tmr(dt)
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local L=text.staff
|
||||
local t=sceneTemp.time
|
||||
setFont(40)
|
||||
|
||||
@@ -45,7 +45,7 @@ function scene.sceneInit()
|
||||
end
|
||||
end
|
||||
|
||||
function scene.Pnt()
|
||||
function scene.draw()
|
||||
local chart=sceneTemp.chart
|
||||
setFont(25)
|
||||
local _,__=SKIN.libColor,SETTING.skin
|
||||
|
||||
Reference in New Issue
Block a user