From a718816176b05b52aef8928ab89e6413e1025c95 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Thu, 2 May 2013 05:40:36 -0700 Subject: [PATCH] Updated Scene System (markdown) --- Scene-System.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Scene-System.md b/Scene-System.md index 6d858fc..894dd7d 100644 --- a/Scene-System.md +++ b/Scene-System.md @@ -9,17 +9,17 @@ The scene system is the backbone of the game client, utilizing the [strategy pat ## Breakdown -main.cpp simply creates an instance of SceneManager, calls it's `Init()`, `Loop()` and `Quit()` functions in order, and handles any fatal exceptions thrown from the rest of the program. -scene_list.hpp holds an enum class of macros, one for each scene in the game. All scenes in the game should include this file in the *.cpp. The macros `QUIT`, `CONTINUE` and `FIRST` are reserved. -base_scene.hpp and base_scene.cpp hold the interface of the strategy pattern i.e. all scenes in the game MUST inherit from the BaseScene class. This class handles the game's screen (which is a static member) and the player's input (via SDL). -scene_manager.hpp and scene_manager.cpp hold the SceneManager class, which initializes and deinitializes the game client, and handles the transition between scenes in the strategy pattern. +`main.cpp` simply creates an instance of `SceneManager`, calls it's `Init()`, `Loop()` and `Quit()` functions in order, and handles any fatal exceptions thrown from the rest of the program. +`scene_list.hpp` holds an enum class of macros, one for each scene in the game. All scenes in the game should include this file in the *.cpp. The macros `QUIT`, `CONTINUE` and `FIRST` are reserved. +`base_scene.hpp` and `base_scene.cpp` hold the interface of the strategy pattern i.e. all scenes in the game MUST inherit from the `BaseScene` class. This class handles the game's screen (which is a static member) and the player's input (via SDL). +`scene_manager.hpp` and `scene_manager.cpp` hold the `SceneManager` class, which initializes and deinitializes the game client, and handles the transition between scenes in the strategy pattern. ## Instructions -To add a new scene to the game, create a class that inherits from BaseScene, overriding any or all of it's members. Then, include the class's header into scene_manager.cpp where it's [indicated](https://github.com/Ratstail91/Tortuga/blob/master/client/scene_manager.cpp#L9). Finally, add a new macro for your scene to scene_list.hpp, and modify SceneManager::LoadScene(SceneIndex) to include that macro and your scene's constructor. -Here's an example, using a class called "NewScene": +To add a new scene to the game, create a class that inherits from `BaseScene`, overriding any or all of it's members. Then, include the class's header into `scene_manager.cpp` where it's [indicated](https://github.com/Ratstail91/Tortuga/blob/master/client/scene_manager.cpp#L9). Finally, add a new macro for your scene to `scene_list.hpp`, and modify `SceneManager::LoadScene(SceneIndex)` to include that macro and your scene's constructor. +Here's an example, using a class called `NewScene`: -```c++11 +```c++ void SceneManager::LoadScene(SceneList sceneIndex) { UnloadScene();