User Tools

Site Tools


en:tutorials:orxscroll:maps-in-scrolled

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:tutorials:orxscroll:maps-in-scrolled [2012/08/19 12:01 (9 years ago)]
acksys
en:tutorials:orxscroll:maps-in-scrolled [2020/08/31 08:51 (15 months ago)] (current)
iarwain ↷ Links adapted because of a move operation
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:​tutorials:​orxscroll:​introduction-orxscroll|Scroll]].
  
 ==== 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 <​code>​-editor</​code> ​command line switch.
  
-You must also specify a map file to edit using the --map switch.+You must also specify a map file to edit using the <​code>​--map</​code> ​switch.
  
 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:
 </​code>​ </​code>​
  
-Orx objects to be used in ScrollEd need a new property ​not supported in Orx +Orx objects to be used in ScrollEd need a new config ​property. The "​ScrollEdSet"​ property is used to define "​object sets" used in ScrollEd.
-Used to define "​object sets" used in ScrollEd+
  
 <​code>​ <​code>​
Line 99: Line 98:
 </​code>​ </​code>​
  
-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("​MyMap.map"​);​
  
 +// Pauses game
 +PauseGame(orxTRUE);​
  
-/ Should restart map? +// Stops game 
-  if(mbRestartMap) +StopGame();
-  { +
-    ​// Pauses ​game +
-    ​PauseGame(orxTRUE);+
  
-    ​// Decreases delay +// Loads map 
-    ​mfRestartDelay -= _rstInfo.fDT;+LoadMap();
  
-    ​// Now? +// Unpauses ​game 
-    if(mfRestartDelay <= orxFLOAT_0) +PauseGame(orxFALSE);
-    { +
-      // Stops game +
-      ​StopGame();+
  
-      ​// Loads map +// Starts game 
-      ​LoadMap(); +StartGame(); 
- +</code> 
-      ​// Unpauses game +  ​ 
-      PauseGame(orxFALSE);+SetMapName, StopGame, LoadMap, ​PauseGame, and StartGame are all defined in the Scroll classes.
  
-      // 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; 
-    } 
-  } 
en/tutorials/orxscroll/maps-in-scrolled.1345402869.txt.gz · Last modified: 2017/05/30 00:50 (5 years ago) (external edit)