Class: BeltsEngine::Tools::SceneManager
- Inherits:
-
Object
- Object
- BeltsEngine::Tools::SceneManager
- Defined in:
- lib/belts_engine/tools/scene_manager.rb
Instance Attribute Summary collapse
-
#current_scene ⇒ Object
readonly
Returns the value of attribute current_scene.
Instance Method Summary collapse
-
#initialize(game) ⇒ SceneManager
constructor
A new instance of SceneManager.
- #load_scene(scene_class) ⇒ Object
- #unload_scene ⇒ Object
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_scene ⇒ Object (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_scene ⇒ Object
10 11 12 |
# File 'lib/belts_engine/tools/scene_manager.rb', line 10 def unload_scene @game.entities.destroy_all end |