Module: Chingu::GameObjectHelpers

Included in:
GameState, Window
Defined in:
lib/chingu/helpers.rb

Instance Method Summary collapse

Instance Method Details

#add_game_object(object) ⇒ Object



146
147
148
# File 'lib/chingu/helpers.rb', line 146

def add_game_object(object)
  @game_objects.add_game_object(object)
end

#game_objectsObject



154
155
156
# File 'lib/chingu/helpers.rb', line 154

def game_objects
  @game_objects
end

#game_objects_of_class(klass) ⇒ Object

Fetch game objects of a certain type/class



161
162
163
# File 'lib/chingu/helpers.rb', line 161

def game_objects_of_class(klass)
  @game_objects.select { |game_object| game_object.is_a? klass }
end

#remove_game_object(object) ⇒ Object



150
151
152
# File 'lib/chingu/helpers.rb', line 150

def remove_game_object(object)
  @game_objects.remove_game_object(object)
end