changing file attr
[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 ; Setup an end sequence animation (blank for nothing).
45 ; Currently supported is fireworks that displays fireworks on exit.
46     (end-sequence-animation "fireworks")
47 ; Level's gravity (better let it 10)
48     (gravity 10)
49 ; We can have one or more playerspawn that can be used by doors.
50 ; "main" is the default one for this sector.
51   (playerspawn
52     (name "main")
53     (x 100)
54     (y 170)
55   )
56 ; Level's music file from data/music
57     (music "fortress.mod")
58 ; This level will use a vertical background
59 ; You can also set a background image by using:
60 ; (background "arctis.jpg")
61     (background
62       (top_red 0)
63       (top_green 0)
64       (top_blue 0)
65       (bottom_red 150)
66       (bottom_green 0)
67       (bottom_blue 0)
68     )
69 ; Now let's go for tilemaps. Tilemaps are the tiles field. We can have more
70 ; than one. Each one has the following properites:
71 ; layer - can be foreground (drawn above player), interactive (interacts with player,
72 ; (solid #t) has to be set, as well), background (drawn below the player).
73 ; speed - this can be used for parallax effects. Better use a level editor (though
74 ; there is not yet one that supports it) to edit this.
75     (tilemap
76       (layer "interactive")
77       (solid #t)
78       (speed 1)
79 ; width and height of the tilemap. Has to be specified.
80       (width 525)
81       (height 15)
82 ; Here goes the tilemap :
83       (tiles 64 64 69 68 68 ...
84        ....
85        ....)
86     )
87 ; Another tilemap, this is the background one
88     (tilemap
89       (layer "background")
90       (solid #f)
91       (speed 1)
92       (width 525)
93       (height 15)
94       (tiles 0 0 ...
95        ... )
96     )
97 ; Yet another one. Normally there are only three.
98     (tilemap
99       (layer "foreground")
100       (solid #f)
101       (speed 1)
102       (width 525)
103       (height 15)
104       (tiles 0 0 0 0 ...
105        ...)
106     )
107 ; Let's setup a few bad guys.
108     (jumpy
109       (x 1277)
110       (y 388)
111 ; stay-on-platform is a flag to tell them not to fall from
112 ; their platforms.
113       (stay-on-platform #f)
114     )
115     (mriceblock
116       (x 4345)
117       (y 380)
118       (stay-on-platform #f)
119     )
120     (stalactite
121       (x 790)
122       (y 96)
123       (stay-on-platform #f)
124     )
125 ; At last, but not least, the camera:
126 ; (Order doesn't matter for Lisp, so camera could be on top or the middle)
127     (camera
128 ; This is the ordinary mode, but we can also have an auto one.
129 ; "auto" can be used to create a path to the camera.
130 ; Here is an example of an auto camera:
131 ;  (camera
132 ;    (mode "autoscroll")
133 ;    (path
134 ;      (point (x 0) (y 0) (speed 0.5))
135 ;      (point (x 500) (y 0) (speed 2))
136 ;      (point (x 1200) (y 0) (speed 1))
137 ;      (point (x 3000) (y 0) (speed 1))
138 ;      (point (x 1500) (y 0) (speed 1.4))
139 ;      (point (x 99999) (y 0))
140 ;    )
141 ;  )
142       (mode "normal")
143 ; backscrolling is only set for normal. It says if player can back
144 ; scroll or not (just go to the front).
145       (backscrolling #t)
146     )
147 ; We could also setup other objects, like trampolins, doors (to swap),
148 ; and moving platform. Please check another level (ie. in test/) that
149 ; uses them to learn more about them.
150   )
151 )
152
153 = LEVEL EDITORS =
154
155 USING THE BUILT-IN LEVEL EDITOR:
156 --------------------------------
157
158 When opening the leveleditor, a menu will appear. This menu
159 can be used to select or add level subsets. A level subset is
160 a collection of levels. Subsets can be chose during gameplay
161 when starting a game.
162
163 After selecting the subset, have a look at the level editor.
164 The button bar in the right is the place where you can control
165 the actions related with editing. You can select levels and add
166 throught there.
167
168 To select tiles (foreground or background) and enemies, the button
169 bar is the right place. There you can also save, test and setup
170 the level. It is also possible between two selection cursors! Give
171 a try to both. A right click in a button bar button will give you
172 a description and a shortcut for it.
173
174 To change a tile, just press the tile you want to change with a
175 left mouse click. The current tile will be used. Depending
176 on the selection behavior, you can or not select more
177 than one tiles.
178
179 To scroll, you just have to point over the two arrow buttons, or
180 use the right button click.
181
182 There is a small help that can be reached by pressing F1.
183
184 To go back to the menu, just press Esc.
185
186 The levels are saved under a .supertux/levels directory in
187 your home directory.
188
189
190 USING FLEXLAY:
191 --------------
192
193 FlexLay is an external project (it even uses different libraries)
194 that is developed by Ingo Ruhnke and supports a lot of different
195 games, including SuperTux (or else we wouldn't mention it :) ).
196
197 Anyway, it is pretty easy to use and is a lot more advanced than
198 the internal one. So, if you are considering doing a few levels
199 for us, it would be a good idea to check this out.
200
201 Its webpage is located at:
202 http://pingus.seul.org/~grumbel/flexlay/
203
204 It needs ClanLib and a few odd libraries... Anyway, it worths
205 it ;)
206
207 The only cons it has is that you have to have an accelerated
208 videocard (with the drivers working, obviously). For linux,
209 we advise nvidia videocards with the use of nvidia's closed
210 drivers. ATI drivers should be enough to run this game though.
211
212
213 = CONCLUSION =
214
215 To sum up, go build lots of levels and HAVE FUN!!
216
217 Please, send your levels or any art, including sketches, you
218 have created to the SuperTux mailing list.
219
220
221     - SuperTux developers