整理代码(修复cc加载失败有时候会报错)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
local gc=love.graphics
|
||||
local kb,tc=love.keyboard,love.touch
|
||||
local rnd=math.random
|
||||
local ins,rem=table.insert,table.remove
|
||||
@@ -50,7 +49,7 @@ function scene.update(dt)
|
||||
counter=counter-1
|
||||
if counter==0 then
|
||||
local N=patron[rnd(#patron)]
|
||||
local T=gc.newText(getFont(N.font),N.name)
|
||||
local T=GC.newText(getFont(N.font),N.name)
|
||||
local r=rnd()<.5
|
||||
ins(names,{
|
||||
text=T,
|
||||
@@ -71,26 +70,26 @@ function scene.update(dt)
|
||||
end
|
||||
|
||||
function scene.draw()
|
||||
gc.replaceTransform(SCR.origin)
|
||||
gc.setColor(1,1,1,.3)
|
||||
GC.replaceTransform(SCR.origin)
|
||||
GC.setColor(1,1,1,.3)
|
||||
for i=1,#names do
|
||||
local N=names[i]
|
||||
gc.draw(N.text,N.x,N.y)
|
||||
GC.draw(N.text,N.x,N.y)
|
||||
end
|
||||
|
||||
gc.replaceTransform(SCR.xOy)
|
||||
GC.replaceTransform(SCR.xOy)
|
||||
local T=40*math.min(time,185)
|
||||
gc.setColor(.97,.97,.97,185-math.min(time,185))
|
||||
GC.setColor(.97,.97,.97,185-math.min(time,185))
|
||||
local L=text.staff
|
||||
setFont(40)
|
||||
for i=1,#L do
|
||||
GC.mStr(L[i],640,950+65*i-T)
|
||||
end
|
||||
gc.setColor(1,1,1)
|
||||
GC.setColor(1,1,1)
|
||||
mDraw(TEXTURE.title_color,640,900-T,nil,.6)
|
||||
mDraw(TEXTURE.title,640,7770-T,nil,.6)
|
||||
if time>190 then
|
||||
gc.print("CLICK ME →",50,550,-.5)
|
||||
GC.print("CLICK ME →",50,550,-.5)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user