button_down(id) method (place it in GameWindow class)def button_down(id)
if id==KbRight then @player.move end
end
button_down? alone.button_down(id) callback as lol_o2 described. The tutorial uses this for the escape key.button_down(id) callback. Then in update, when the button is down? you would see if the variable is still bigger than 30, move a bit and subtract the pixels. Otherwise, you wouldn't move (30 pixels already used up).
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill