When you press multiple buttons on keyboard and process the input information, there is a reproduceable small bug. it happens when you press 2 movement keys and the space key simulatnious.
I will explain:
If you press right key + down key + space key simultanious the “space key=>fire” will not trigger in “on_input”
if you press left key + down key + space key simultanious the “space key => fire” will trigger in “on_input”
the setup to reproduce:
the code to reproduce:
function on_input(self, action_id, action)
if action_id == hash("fire") then
if (os.clock() - self.lastfire > 0.13) then
self.firing = true
self.lastfire=os.clock()
end
end
if action_id == hash("up") then
self.input.y = 1
self.moving = true
elseif action_id == hash("down") then
self.input.y = -1
self.moving = true
elseif action_id == hash("left") then
self.input.x = -1
self.moving = true
elseif action_id == hash("right") then
self.input.x = 1
self.moving = true
end
end