整 理 代 码
(应该没有改到字符串里面的东西吧…)起码不直接影响运行
This commit is contained in:
@@ -42,8 +42,8 @@ end
|
||||
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=='space'or key=='return'then
|
||||
if state=='move'then
|
||||
if key=='space' or key=='return' then
|
||||
if state=='move' then
|
||||
if floor>0 then
|
||||
if move.x<base.x then
|
||||
move.x=move.x+10
|
||||
@@ -53,16 +53,16 @@ function scene.keyDown(key,isRep)
|
||||
end
|
||||
SFX.play('hold')
|
||||
state='drop'
|
||||
elseif state=='dead'then
|
||||
elseif state=='dead' then
|
||||
move.x,move.y,move.l=1e99,0,0
|
||||
base.x,base.y,base.l=1e99,0,0
|
||||
state='scroll'
|
||||
elseif state=='menu'then
|
||||
elseif state=='menu' then
|
||||
restart()
|
||||
state='move'
|
||||
end
|
||||
elseif key=='escape'then
|
||||
if tryBack()then
|
||||
elseif key=='escape' then
|
||||
if tryBack() then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
@@ -77,13 +77,13 @@ function scene.touchDown()
|
||||
end
|
||||
|
||||
function scene.update()
|
||||
if state=='move'then
|
||||
if state=='move' then
|
||||
move.x=move.x+speed
|
||||
if speed<0 and move.x<=0 or speed>0 and move.x+move.l>=1280 then
|
||||
SFX.play('lock')
|
||||
speed=-speed
|
||||
end
|
||||
elseif state=='drop'then
|
||||
elseif state=='drop' then
|
||||
move.y=move.y+18
|
||||
if move.y>=660 then
|
||||
if move.x>base.x+base.l or move.x+move.l<base.x then
|
||||
@@ -98,7 +98,7 @@ function scene.update()
|
||||
state='shorten'
|
||||
end
|
||||
end
|
||||
elseif state=='shorten'then
|
||||
elseif state=='shorten' then
|
||||
if move.x>base.x+base.l or move.x+move.l<base.x then
|
||||
state='die'
|
||||
elseif move.x<base.x then
|
||||
@@ -109,7 +109,7 @@ function scene.update()
|
||||
else
|
||||
state='climb'
|
||||
end
|
||||
elseif state=='climb'then
|
||||
elseif state=='climb' then
|
||||
if base.y<720 then
|
||||
move.y=move.y+3
|
||||
base.y=base.y+3
|
||||
@@ -140,14 +140,14 @@ function scene.update()
|
||||
move.y=rnd(max(260-floor*4,60),max(420-floor*5,100))
|
||||
state='move'
|
||||
end
|
||||
elseif state=='die'then
|
||||
elseif state=='die' then
|
||||
move.y=move.y+18
|
||||
if move.y>1000 then
|
||||
highScore=max(score,highScore)
|
||||
highFloor=max(floor,floor)
|
||||
state='dead'
|
||||
end
|
||||
elseif state=='scroll'then
|
||||
elseif state=='scroll' then
|
||||
camY=camY-floor/4
|
||||
if camY<1000 then camY=camY-1 end
|
||||
if camY<500 then camY=camY-1 end
|
||||
@@ -177,16 +177,16 @@ setmetatable(backColor,backColor)
|
||||
function scene.draw()
|
||||
--Background
|
||||
local lv,height=int(camY/700),camY%700
|
||||
gc.setColor(backColor[lv+1]or COLOR.D)
|
||||
gc.setColor(backColor[lv+1] or COLOR.D)
|
||||
gc.rectangle('fill',0,720,1280,height-700)
|
||||
gc.setColor(backColor[lv+2]or COLOR.D)
|
||||
gc.setColor(backColor[lv+2] or COLOR.D)
|
||||
gc.rectangle('fill',0,height+20,1280,-height-20)
|
||||
if height-680>0 then
|
||||
gc.setColor(backColor[lv+3]or COLOR.D)
|
||||
gc.setColor(backColor[lv+3] or COLOR.D)
|
||||
gc.rectangle('fill',0,height-680,1280,680-height)
|
||||
end
|
||||
|
||||
if state=='menu'or state=='dead'then
|
||||
if state=='menu' or state=='dead' then
|
||||
setFont(100)
|
||||
gc.setColor(COLOR.rainbow_light(TIME()*2.6))
|
||||
mStr("DROPPER",640,120)
|
||||
@@ -199,12 +199,12 @@ function scene.draw()
|
||||
|
||||
gc.setColor(COLOR.D)
|
||||
setFont(35)
|
||||
mStr(MOBILE and"Touch to Start"or"Press space to Start",640,570)
|
||||
mStr(MOBILE and "Touch to Start" or "Press space to Start",640,570)
|
||||
setFont(20)
|
||||
gc.print("Original CX-CAS version by MrZ",740,235)
|
||||
gc.print("Ported / Rewritten / Balanced by MrZ",740,260)
|
||||
end
|
||||
if state~='menu'then
|
||||
if state~='menu' then
|
||||
--High floor
|
||||
gc.setColor(COLOR.Z)
|
||||
gc.setLineWidth(2)
|
||||
|
||||
Reference in New Issue
Block a user