Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lua 科罗纳SDK。更长的按钮压力->;更强的效果(例如更高的跳跃)_Lua_Coronasdk - Fatal编程技术网

Lua 科罗纳SDK。更长的按钮压力->;更强的效果(例如更高的跳跃)

Lua 科罗纳SDK。更长的按钮压力->;更强的效果(例如更高的跳跃),lua,coronasdk,Lua,Coronasdk,我想不出在科罗纳实现它的任何方法。你有什么想法/建议吗?谢谢 在事件中定义并增加你的力量。阶段==开始。感谢修复pookzilla! local timeOfPressing = 9999999; local buttonPressed = false; local function keyListener( event ) if event.phase == "began" then timeOfPressing = event.time; button

我想不出在科罗纳实现它的任何方法。你有什么想法/建议吗?谢谢

在事件中定义并增加你的力量。阶段==开始。

感谢修复pookzilla!
local timeOfPressing = 9999999;
local buttonPressed = false;
local function keyListener( event )
    if event.phase == "began" then
        timeOfPressing = event.time;
        buttonPressed = true;
    elseif event.phase == "ended" and buttonPressed then
        local force = event.time - timeOfPressing;
        if force > maximumForce then force = maximumForce end
        buttonPressed = false;
        myJumpFunction(force);
    end
end