小游戏cannon支持鼠标和触屏操作

This commit is contained in:
MrZ626
2021-03-06 21:02:51 +08:00
parent c7e7198dc6
commit 1fba135b4d

View File

@@ -33,6 +33,16 @@ function scene.keyDown(key)
SCN.back()
end
end
function scene.mouseDown(k)
if k==1 then
scene.keyDown("space")
elseif k==2 then
SCN.back()
end
end
function scene.touchDown()
scene.keyDown("space")
end
function scene.update()
timer=timer+1