Input issues while trying to "stun" main character (SOLVED)

Yep, that’s right. This is an example of what my whole on input looks like

if action_id == hash("up") then
        if action.pressed then
        	self.up = true
        elseif action.released then
        	self.up = false
-- etc...

Then we jump to update

if self.up then
			p.y = p.y + self.speed * dt
			if p.y >= screen_height - 35 then
				self.up = false
			end
		end
-- etc...

I think I’m going to have to change the whole thing, because it wont work without the release events with the way that I have it setup. I found a thread What is the most elemental way to move an Sprite in four directions? where you and PKeod give different examples of how to implement input, some of which at a cursory glance look like they don’t require release events, so I’ll try out one of those options, cheers :+1:

1 Like