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