Sha256: ea2b4c3ba07cfcd7416a5ff975b75dedce96ba3e4232133e1845bb1c278c1dc5
Contents?: true
Size: 742 Bytes
Versions: 20
Compression:
Stored size: 742 Bytes
Contents
# Controls for a controllable. # Example: # # Note: left, right, full_speed_ahead, reverse, revive are # # methods on the @player. # # # @controls << Controls.new(self, @player, # Gosu::Button::KbA => :left, # Gosu::Button::KbD => :right, # Gosu::Button::KbW => :full_speed_ahead, # Gosu::Button::KbS => :reverse, # Gosu::Button::Kb1 => :revive # ) # # # class Controls # # def initialize window, controllable @window = window @controllable = controllable @mapping = controllable.controls_mapping end # # def handle return if @controllable.destroyed? @mapping.each do |key, command| @controllable.send(command) if @window.button_down? key end end end
Version data entries
20 entries across 20 versions & 1 rubygems