This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:orx:tutorials:community:acksys:scrolled0 [2012/08/19 19:01 (13 years ago)] – acksys | en:tutorials:orxscroll:maps-in-scrolled [2025/09/30 17:26 (6 weeks ago)] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Creating Maps in ScrollEd ===== | ===== Creating Maps in ScrollEd ===== | ||
| - | ScrollEd is a map/level editor that can be used with Scroll. | + | ScrollEd is a map/level editor that can be used with [[en: |
| ==== Compiling ScrollEd with Scroll ==== | ==== Compiling ScrollEd with Scroll ==== | ||
| Line 15: | Line 15: | ||
| ==== Running ScrollEd ==== | ==== Running ScrollEd ==== | ||
| - | Running your game's executable will start the game by default. If you want to start ScrollEd, you need to run the executable with the -editor command line switch. | + | Running your game's executable will start the game by default. If you want to start ScrollEd, you need to run the executable with the < |
| - | You must also specify a map file to edit using the --map switch. | + | You must also specify a map file to edit using the < |
| If you don't want to specify a map file on the command line every time, you can specify a default map file in Orx config as follows: | If you don't want to specify a map file on the command line every time, you can specify a default map file in Orx config as follows: | ||
| Line 26: | Line 26: | ||
| </ | </ | ||
| - | Orx objects to be used in ScrollEd need a new property | + | Orx objects to be used in ScrollEd need a new config |
| - | Used to define " | + | |
| < | < | ||
| Line 99: | Line 98: | ||
| </ | </ | ||
| - | Call SetMapName from the Scroll class to load the map in Scroll | + | Place your objects as you like them and then press F6 to save your map! |
| + | ===== Loading ScrollEd maps in Scroll | ||
| - | Then do the following: | + | When you want to load a new map, you need to tell Scroll to load the new map. You probably also want to pause the game while this is happening. Your game's Update function might be a good place to check and implement this. |
| - | // Asks for map restart | + | Use the following routine to accomplish the map load: |
| - | mbRestartMap = orxTRUE; | + | |
| - | mbRestartMap is checked in the Update function and does the following if true: | + | <code c> |
| + | // Sets map name | ||
| + | SetMapName(" | ||
| + | // Pauses game | ||
| + | PauseGame(orxTRUE); | ||
| - | / Should restart map? | + | // Stops game |
| - | if(mbRestartMap) | + | StopGame(); |
| - | { | + | |
| - | | + | |
| - | | + | |
| - | | + | // Loads map |
| - | | + | LoadMap(); |
| - | | + | // Unpauses |
| - | if(mfRestartDelay <= orxFLOAT_0) | + | PauseGame(orxFALSE); |
| - | { | + | |
| - | // Stops game | + | |
| - | | + | |
| - | | + | // Starts game |
| - | | + | StartGame(); |
| - | + | </code> | |
| - | | + | |
| - | PauseGame(orxFALSE); | + | SetMapName, StopGame, LoadMap, |
| - | // Starts game | + | Scroll also includes an OnMapLoad virtual function callback. You can override this if you want to wait until the map is loaded to execute code. |
| - | StartGame(); | + | |
| - | // Clears restart status | ||
| - | mbRestartMap = orxFALSE; | ||
| - | } | ||
| - | } | ||