整理代码
This commit is contained in:
@@ -2,11 +2,8 @@ local gc=love.graphics
|
|||||||
local int,rnd,abs,sin,cos=math.floor,math.random,math.abs,math.sin,math.cos
|
local int,rnd,abs,sin,cos=math.floor,math.random,math.abs,math.sin,math.cos
|
||||||
|
|
||||||
local pow,ang
|
local pow,ang
|
||||||
local state,timer
|
local state,timer,score,combo
|
||||||
local score,combo
|
local x,y,vx,vy,ex,ey
|
||||||
local x,y
|
|
||||||
local vx,vy
|
|
||||||
local ex,ey
|
|
||||||
|
|
||||||
local scene={}
|
local scene={}
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
@@ -81,17 +78,17 @@ function scene.update()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local scoreColor={
|
local scoreColor={
|
||||||
"white",--0
|
"Z",--0
|
||||||
"aqua",--20
|
"A",--20
|
||||||
"navy",--40
|
"N",--40
|
||||||
"blue",--60
|
"B",--60
|
||||||
"purple",--80
|
"P",--80
|
||||||
"wine",--100
|
"W",--100
|
||||||
"red","fire","orange","yellow","lAqua",--200
|
"R","F","O","Y","lA",--200
|
||||||
"lNavy","lBlue","lPurple","lWine","lRed",--300
|
"lN","lB","lP","lW","lR",--300
|
||||||
"lFire","lOrange","lYellow","dAqua","dNavy",--400
|
"lF","lO","lY","dA","dN",--400
|
||||||
"dBlue","dPurple","dWine","dRed","dFire",--500
|
"dB","dP","dW","dR","dF",--500
|
||||||
"dYellow","lH","H","dH",--before 600, black after
|
"dY","lH","H","dH",--before 600, black after
|
||||||
}
|
}
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Spawn area
|
--Spawn area
|
||||||
@@ -116,7 +113,7 @@ function scene.draw()
|
|||||||
gc.setColor(1,1,.6)
|
gc.setColor(1,1,.6)
|
||||||
gc.print("x"..combo,300,80)
|
gc.print("x"..combo,300,80)
|
||||||
end
|
end
|
||||||
gc.setColor(COLOR[scoreColor[int(score/20)+1]or"black"])
|
gc.setColor(COLOR[scoreColor[int(score/20)+1]or"D"])
|
||||||
gc.print(score,300,30)
|
gc.print(score,300,30)
|
||||||
|
|
||||||
--Cannon ball
|
--Cannon ball
|
||||||
|
|||||||
Reference in New Issue
Block a user