I’m really new to this engine, but previously made pretty same game on PSP lua engine. Sources are already lost, and I don’t remember how to code Lua, so, I am actually a newbie again. The question is, how to make game read the button input only once, even if I hold the key. Hope for your assist, folks. Here’s the code:
function init(self)
msg.post(".", "acquire_input_focus")
self.move = vmath.vector3()
self.job = false
end
function final(self)
-- Add finalization code here
-- Remove this function if not needed
end
function update(self, dt)
self.move.x = 0
end
function on_message(self, message_id, message, sender)
-- Add message-handling code here
-- Remove this function if not needed
end
function on_input(self, action_id, action)
if action_id == hash("leftstep") then
self.move.x = -10
end
end
function on_reload(self)
-- Add reload-handling code here
-- Remove this function if not needed
end