整理框架代码

整理手柄的摇杆/扳机支持代码
This commit is contained in:
MrZ626
2021-11-22 15:59:57 +08:00
parent d38897b54d
commit 940ac3736c
4 changed files with 72 additions and 147 deletions

View File

@@ -9,9 +9,9 @@ local scene={}
function scene.sceneInit()
BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926}
stateInfo=SYSTEM.."-"..VERSION.string.." scene:"..ERRDATA[#ERRDATA].scene
stateInfo=SYSTEM.."-"..VERSION.string.." scene:"..Z.errData[#Z.errData].scene
errorText=LOADED and text.errorMsg or"An error has occurred during loading.\nError info has been created, and you can send it to the author."
errorShot,errorInfo=ERRDATA[#ERRDATA].shot,ERRDATA[#ERRDATA].mes
errorShot,errorInfo=Z.errData[#Z.errData].shot,Z.errData[#Z.errData].mes
NET.wsclose_app()
NET.wsclose_user()
NET.wsclose_play()

View File

@@ -162,7 +162,7 @@ function scene.update()
if kb.isDown("down","s")then dy=dy-10 F=true end
if kb.isDown("left","a")then dx=dx+10 F=true end
if kb.isDown("right","d")then dx=dx-10 F=true end
local js1=joysticks[1]
local js1=Z.js[1]
if js1 then
local dir=js1:getAxis(1)
if dir~="c"then