if button_down?(KbDown) and !@pressed
elsif not button_down?(KbDown)
if id==KbDown then @index+=1 end
button_downis a method that you write and wait for Gosu to call it whenever a button is pushed down.
button_down?is a method that you call to ask Gosu whether a button is being held down right now. Gosu never calls
button_downis what you use for one-time button presses, and
button_down?is what you use to make buttons influence code in
update- for example, walking left and right is a case for
button_down?because you don't want the player to move only one pixel when he first hits the button, but you want them to move in every
class MyWindow ...
if id == Gosu::KbDown then
class YourWindow < Gosu::Window
Powered by mwForum 2.29.0 © 1999-2013 Markus Wichitill