整理代码,较复杂的单行if-then-end拆成多行
This commit is contained in:
@@ -4,10 +4,10 @@ local sin=math.sin
|
||||
local back={}
|
||||
|
||||
local t
|
||||
local txt
|
||||
local textObj
|
||||
function back.init()
|
||||
t=math.random()*2600
|
||||
txt=gc.newText(getFont(80),"Welcome To Techmino")
|
||||
textObj=gc.newText(getFont(80),"Welcome To Techmino")
|
||||
end
|
||||
function back.update(dt)
|
||||
t=t+dt
|
||||
@@ -21,7 +21,7 @@ function back.draw()
|
||||
gc.push('transform')
|
||||
gc.translate(SCR.cx,SCR.cy+20*sin(t*.02))
|
||||
gc.scale(SCR.k)
|
||||
gc.scale(1.1626,1.26)
|
||||
gc.scale(1.26,1.36)
|
||||
if -t%6.26<.1355 then
|
||||
gc.translate(60*sin(t*.26),100*sin(t*.626))
|
||||
end
|
||||
@@ -29,11 +29,11 @@ function back.draw()
|
||||
gc.rotate(t+5*sin(.26*t)+5*sin(.626*t))
|
||||
end
|
||||
gc.setColor(.4,.6,1,.3)
|
||||
gc.draw(txt,-883*.5+4*sin(t*.7942),-110*.5+4*sin(t*.7355))
|
||||
mDraw(textObj,4*sin(t*.7942),4*sin(t*.7355))
|
||||
gc.setColor(.5,.7,1,.4)
|
||||
gc.draw(txt,-883*.5+2*sin(t*.77023),-110*.5+2*sin(t*.7026))
|
||||
mDraw(textObj,2*sin(t*.77023),2*sin(t*.7026))
|
||||
gc.setColor(1,1,1,.5)
|
||||
gc.draw(txt,-883*.5+3*sin(t*.7283),-110*.5+3*sin(t*.7626))
|
||||
mDraw(textObj,3*sin(t*.7283),3*sin(t*.7626))
|
||||
gc.pop()
|
||||
end
|
||||
return back
|
||||
|
||||
Reference in New Issue
Block a user