Class: BeltsEngine::Tools::SceneManager

Inherits:
Object
  • Object
show all
Defined in:
lib/belts_engine/tools/scene_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game) ⇒ SceneManager

Returns a new instance of SceneManager.



5
6
7
8
# File 'lib/belts_engine/tools/scene_manager.rb', line 5

def initialize(game)
  @game = game
  @current_scene = nil
end

Instance Attribute Details

#current_sceneObject (readonly)

Returns the value of attribute current_scene.



3
4
5
# File 'lib/belts_engine/tools/scene_manager.rb', line 3

def current_scene
  @current_scene
end

Instance Method Details

#load_scene(scene_class) ⇒ Object



14
15
16
17
# File 'lib/belts_engine/tools/scene_manager.rb', line 14

def load_scene(scene_class)
  unload_scene
  @current_scene = scene_class.new(@game)
end

#unload_sceneObject



10
11
12
# File 'lib/belts_engine/tools/scene_manager.rb', line 10

def unload_scene
  @game.entities.destroy_all
end