This wiki has been moved to into the mediawiki branch.


From SuperTux
Revision as of 00:57, 28 June 2006 by Sommer (Talk | contribs)

Jump to: navigation, search


Supertux levels are composed from tiles. Little 32x32 pixel wide images. These tiles are defined in an s-expr based file, "data/images/tiles.strf". A tile has an ID number a set of images (it's an animated tile if it has more than 1 image) and contains a set of attributes like solid, icy, anim-fps...


An example of a simple solid tile looks like this:

   (id 7)

An animated waterfall tile (animation played with 10 fps):

   (id 175)
   (water #t)
   (anim-fps 10)

It's also possible to extract parts of bigger images to create tiles. This extracts the upper left edge of the foresttiles-1.png file:

   (id 1000)
     (region "tiles/forest/foresttiles-1.png" 0 0 32 32)

Note that in Milestone 2, the last variant is depreceated in favour of a more compact approach at defining multiple tiles:

   (width 3)
   (height 4)
   (ids  7  8  9
        13 14 15
        10 11 12
        16 17 18)
   (attributes 0 0 0
               1 1 1
               1 1 1
               0 0 0)
   (image "tiles/snow/convex.png")

In this example, a block of 3x4 tiles will be extracted from an image with only the middle rows solid.

Tile attributes

Tiles can have the following attributes:

  • solid defines if the tile should be considered for collision detection
  • unisolid the tile will only be considered for collision detection when tux is falling down. That is you can jump through the tile from below but not fall through it.
  • brick A brick that can be destroyed by jumping under it
  • goal The level should be finished when touching a goaltile. If data is 0 then the endsequence should be triggered, if data is 1 then the level is finished instantly.
  • fullbox Bonusbox, content is stored in data
  • coin The tile is a coin
  • ice the tile will be slippery (currently not implemented)
  • water The tile is a water tile (needed for fish enemy)
  • hurts The tile will hurt you when you hit it
  • slope-type The tile is a slope. You have to add a slope number to reference what sort of slope the tile is. Take a look for possible types here (take the basic form and add the deform to get the number)


Adding new tiles

You can simply add new tiles with your favourite text editor. However we also provide an easy to use editor to make this task easier (especially extracting regions of bigger images). You can find it in the tools/tilemanager directory. It's a mono/gtk# app so you have to have these 2 things installed and should invoke make in that directory then. It'll create tilemanager.exe which you can then start with mono like this:

 mono tilemanager.exe

NOTE: You should be carefull when choosing tile ids to not overwrite existing tiles. You should also keep in mind that existing levels will break if you change tile numbers later (the levels just save a big a list of numbers that reference the tile file).


Simply open the flexlay or ST# editor and the new tiles should appear.