Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local timer = -1
minetest.register_globalstep(function (dtime)
if timer == -1 then
for _,player in ipairs(minetest.get_connected_players()) do
local ctrl = player:get_player_control()
if ctrl.jump then
print("Player jumped!") -- I haven't built the code to actually play the sound yet...
timer = 0
end
end
else
timer = timer + dtime
if timer >= 0.65 then -- this is a fudged number
timer = -1
end
end
end)
What I am hoping for is something similar to this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
player.on_jump = function(player)
Where the function is called when the player jumps, every time.