整理代码,略微调整小游戏dtw的交互

This commit is contained in:
MrZ626
2021-02-25 01:06:02 +08:00
parent 57003e3e8a
commit c42bb942f1
2 changed files with 7 additions and 8 deletions

View File

@@ -83,10 +83,10 @@ end
local scene={}
function scene.sceneInit()
BG.set("grey")
BGM.play("way")
mode=1
reset()
BG.set("grey")
BGM.play("way")
end
local function touch(n)
@@ -114,7 +114,7 @@ local function touch(n)
end
end
height=height+120
SFX.play("lock")
SFX.play("move")
else
time=TIME()-startTime
state=2
@@ -130,7 +130,7 @@ function scene.keyDown(key)
elseif key=="f"or key=="v"then touch(2)
elseif key=="j"or key=="n"then touch(3)
elseif key=="k"or key=="m"then touch(4)
elseif key=="q"and state==0 then
elseif(key=="q"or key=="tab")and state==0 then
mode=mode%#modeName+1
reset()
end

View File

@@ -12,13 +12,12 @@ local speed=0
local maxSpeed=260
function scene.sceneInit()
BG.set("grey")
BGM.play("push")
love.keyboard.setKeyRepeat(false)
lastKey=nil
speed=0
keyTime={}for i=1,20 do keyTime[i]=-1e99 end
love.keyboard.setKeyRepeat(false)
BG.set("grey")
BGM.play("push")
end
function scene.sceneBack()
love.keyboard.setKeyRepeat(true)