levelformat.txt 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. Note: the "official" editor for supertux is now flexlay
  2. (http://flexlay.berlios.de)
  3. - Level editing for SuperTux -
  4. http://supertux.lethargik.org/
  5. Last update: April 26, 2004
  6. This document describes both the level format and
  7. the level editor.
  8. = LEVEL FORMAT =
  9. Since the level editor does not support anything, you might have
  10. to edit a couple of things directly from the level file, so it
  11. might be a better idea to read this.
  12. Level format should be pretty straight forward. The syntax is the
  13. Scheme one. But even if you have no idea about it, no worry,
  14. it is pretty intuitive.
  15. Attention: this describes the new level format. But current levels
  16. still use the old one, since the engine still supports it and also
  17. level editors still use it.
  18. To explain a bit of the level format, there is nothing better than
  19. really looking at it. So here goes a quote of it. The comments
  20. prefix-ed by a ';', describe what everything is about.
  21. ; This is a comment!
  22. ; Level made using SuperTux's built-in Level Editor
  23. (supertux-level
  24. ; version higher than 1 means that it follows the new level format (CVS)
  25. (version 2)
  26. ; Level's title and author name
  27. (name "The Castle of Nolok")
  28. (author "Ingo Ruhnke")
  29. ; Time the player has to finish the level (it is not in seconds!)
  30. (time 300)
  31. ; Each level has one or more sectors. Sectors can be seen as levels inside this
  32. ; level. Their use is for swapping.
  33. (sector
  34. ; Naming sectors is useful for swapping
  35. ; "main" sectors are the ones that the player will start in
  36. (name "main")
  37. ; Setup an end sequence animation (blank for nothing).
  38. ; Currently supported is fireworks that displays fireworks on exit.
  39. (end-sequence-animation "fireworks")
  40. ; Level's gravity (better let it 10)
  41. (gravity 10)
  42. ; We can have one or more playerspawn that can be used by doors.
  43. ; "main" is the default one for this sector.
  44. (playerspawn
  45. (name "main")
  46. (x 100)
  47. (y 170)
  48. )
  49. ; Level's music file from data/music
  50. (music "fortress.mod")
  51. ; This level will use a vertical background
  52. ; You can also set a background image by using:
  53. ; (background "arctis.jpg")
  54. (background
  55. (top_red 0)
  56. (top_green 0)
  57. (top_blue 0)
  58. (bottom_red 150)
  59. (bottom_green 0)
  60. (bottom_blue 0)
  61. )
  62. ; Now let's go for tilemaps. Tilemaps are the tiles field. We can have more
  63. ; than one. Each one has the following properties:
  64. ; layer - can be foreground (drawn above player), interactive (interacts with player,
  65. ; (solid #t) has to be set, as well), background (drawn below the player).
  66. ; speed - this can be used for parallax effects. Better use a level editor (though
  67. ; there is not yet one that supports it) to edit this.
  68. (tilemap
  69. (layer "interactive")
  70. (solid #t)
  71. (speed 1)
  72. ; width and height of the tilemap. Has to be specified.
  73. (width 525)
  74. (height 15)
  75. ; Here goes the tilemap :
  76. (tiles 64 64 69 68 68 ...
  77. ....
  78. ....)
  79. )
  80. ; Another tilemap, this is the background one
  81. (tilemap
  82. (layer "background")
  83. (solid #f)
  84. (speed 1)
  85. (width 525)
  86. (height 15)
  87. (tiles 0 0 ...
  88. ... )
  89. )
  90. ; Yet another one. Normally there are only three.
  91. (tilemap
  92. (layer "foreground")
  93. (solid #f)
  94. (speed 1)
  95. (width 525)
  96. (height 15)
  97. (tiles 0 0 0 0 ...
  98. ...)
  99. )
  100. ; Let's setup a few bad guys.
  101. (jumpy
  102. (x 1277)
  103. (y 388)
  104. ; stay-on-platform is a flag to tell them not to fall from
  105. ; their platforms.
  106. (stay-on-platform #f)
  107. )
  108. (mriceblock
  109. (x 4345)
  110. (y 380)
  111. (stay-on-platform #f)
  112. )
  113. (stalactite
  114. (x 790)
  115. (y 96)
  116. (stay-on-platform #f)
  117. )
  118. ; At last, but not least, the camera:
  119. ; (Order doesn't matter for Lisp, so camera could be on top or the middle)
  120. (camera
  121. ; This is the ordinary mode, but we can also have an auto one.
  122. ; "auto" can be used to create a path to the camera.
  123. ; Here is an example of an auto camera:
  124. ; (camera
  125. ; (mode "autoscroll")
  126. ; (path
  127. ; (point (x 0) (y 0) (speed 0.5))
  128. ; (point (x 500) (y 0) (speed 2))
  129. ; (point (x 1200) (y 0) (speed 1))
  130. ; (point (x 3000) (y 0) (speed 1))
  131. ; (point (x 1500) (y 0) (speed 1.4))
  132. ; (point (x 99999) (y 0))
  133. ; )
  134. ; )
  135. (mode "normal")
  136. ; backscrolling is only set for normal. It says if player can back
  137. ; scroll or not (just go to the front).
  138. (backscrolling #t)
  139. )
  140. ; We could also setup other objects, like trampolines, doors (to swap),
  141. ; and moving platform. Please check another level (ie. in test/) that
  142. ; uses them to learn more about them.
  143. )
  144. )
  145. = LEVEL EDITORS =
  146. USING THE BUILT-IN LEVEL EDITOR:
  147. --------------------------------
  148. When opening the leveleditor, a menu will appear. This menu
  149. can be used to select or add level subsets. A level subset is
  150. a collection of levels. Subsets can be chose during gameplay
  151. when starting a game.
  152. After selecting the subset, have a look at the level editor.
  153. The button bar in the right is the place where you can control
  154. the actions related with editing. You can select levels and add
  155. through there.
  156. To select tiles (foreground or background) and enemies, the button
  157. bar is the right place. There you can also save, test and setup
  158. the level. It is also possible between two selection cursors! Give
  159. a try to both. A right click in a button bar button will give you
  160. a description and a shortcut for it.
  161. To change a tile, just press the tile you want to change with a
  162. left mouse click. The current tile will be used. Depending
  163. on the selection behavior, you can or not select more
  164. than one tiles.
  165. To scroll, you just have to point over the two arrow buttons, or
  166. use the right button click.
  167. There is a small help that can be reached by pressing F1.
  168. To go back to the menu, just press Esc.
  169. The levels are saved under a .supertux/levels directory in
  170. your home directory.
  171. USING FLEXLAY:
  172. --------------
  173. FlexLay is an external project (it even uses different libraries)
  174. that is developed by Ingo Ruhnke and supports a lot of different
  175. games, including SuperTux (or else we wouldn't mention it :) ).
  176. Anyway, it is pretty easy to use and is a lot more advanced than
  177. the internal one. So, if you are considering doing a few levels
  178. for us, it would be a good idea to check this out.
  179. Its webpage is located at:
  180. http://pingus.seul.org/~grumbel/flexlay/
  181. It needs ClanLib and a few odd libraries... Anyway, it worths
  182. it ;)
  183. The only cons it has is that you have to have an accelerated
  184. videocard (with the drivers working, obviously). For linux,
  185. we advise nvidia videocards with the use of nvidia's closed
  186. drivers. ATI drivers should be enough to run this game though.
  187. = CONCLUSION =
  188. To sum up, go build lots of levels and HAVE FUN!!
  189. Please, send your levels or any art, including sketches, you
  190. have created to the SuperTux mailing list.
  191. - SuperTux developers