Module: Lotu::Controllable
- Defined in:
- lib/lotu/behaviors/controllable.rb
Class Method Summary collapse
Instance Method Summary collapse
- #init_behavior ⇒ Object
-
#set_keys(keys) ⇒ Object
This will call #go_up every game loop Gosu::Button::KbUp => :go_up This is the same as the above Gosu::Button::KbUp => [:go_up, 0].
Class Method Details
.extended(instance) ⇒ Object
5 6 7 |
# File 'lib/lotu/behaviors/controllable.rb', line 5 def self.extended(instance) instance.init_behavior end |
Instance Method Details
#init_behavior ⇒ Object
9 10 11 |
# File 'lib/lotu/behaviors/controllable.rb', line 9 def init_behavior @input_controller = nil end |
#set_keys(keys) ⇒ Object
This will call #go_up every game loop Gosu::Button::KbUp => :go_up This is the same as the above Gosu::Button::KbUp => [:go_up, 0]
This will call #go_up once Gosu::Button::KbUp => [:go_up, false]
This will call #go_up every 50ms Gosu::Button::KbUp => [:go_up, 50]
23 24 25 |
# File 'lib/lotu/behaviors/controllable.rb', line 23 def set_keys(keys) @input_controller = InputController.new(self, keys) end |