整理代码(修复cc加载失败有时候会报错)

This commit is contained in:
MrZ_26
2022-11-07 16:46:24 +08:00
parent 7f7ea6ac97
commit e1200b5038
4 changed files with 96 additions and 99 deletions

View File

@@ -1,9 +1,9 @@
local gc,sys=love.graphics,love.system
local sys=love.system
local kb=love.keyboard
local sin=math.sin
local ins,rem=table.insert,table.remove
local gc_setColor,gc_print=gc.setColor,gc.print
local gc_setColor,gc_print=GC.setColor,GC.print
local scene={}
@@ -112,12 +112,12 @@ function scene.keyDown(key)
end
end
local blockCharWidth={} for i=1,#BLOCK_CHARS do blockCharWidth[i]=gc.newText(FONT.get(60),BLOCK_CHARS[i]):getWidth() end
local blockCharWidth={} for i=1,#BLOCK_CHARS do blockCharWidth[i]=GC.newText(FONT.get(60),BLOCK_CHARS[i]):getWidth() end
function scene.draw()
-- Draw frame
gc_setColor(COLOR.Z)
gc.setLineWidth(2)
gc.rectangle('line',100,110,1080,260,5)
GC.setLineWidth(2)
GC.rectangle('line',100,110,1080,260,5)
-- Draw sequence
local BLOCK_COLORS=BLOCK_COLORS
@@ -166,7 +166,7 @@ function scene.draw()
-- Draw cursor
gc_setColor(.5,1,.5,.6+.4*sin(TIME()*6.26))
gc.line(cx-5,cy-20,cx-5,cy+20)
GC.line(cx-5,cy-20,cx-5,cy+20)
end
scene.widgetList={