This wiki has been moved to into the mediawiki branch.


From SuperTux
Jump to: navigation, search


A Tilemap that was given a name can be controlled by scripts. The tilemap can be moved by specifying a path for it.


An instance is created by being defined in a level. It may be accessed via its name from scripts and via from the console.


Example of a definition:

   (name "niftymap")
     (mode "circular")
       (x 832)
       (y 800)
       (time 10)
       (x 832)
       (y 704)
       (time 10)
   (width …)
   (height …)
   (tiles …)
   (solid #t)

The above tilemap will be exposed under the name “niftymap” in the scripting engine. Example usage:

 niftymap.fade(0.0, 10);

This will cause the tilemap to slowly move left, fading out as it goes, and disappear completely when it reaches its destination. Never fear, though; it is still there. From the console, you can enter:

 sector.niftymap.fade(1.0, 15)

The tilemap will then reverse its previous actions, ending up back where it started, but it will only reach full opacity 5 seconds after it stops.


goto_node(int node_no) Move tilemap along path until at given node, then stop.
start_moving() Start moving tilemap
stop_moving() Stop tilemap at next node
fade(float alpha, float seconds) Start fading the tilemap to opacity given by alpha. Destination opacity will be reached after seconds game seconds. Also influences solidity.
set_alpha(float alpha) Instantly switch tilemap's opacity to alpha. Also influences solidity.
float get_alpha() Return the tilemap's opacity. Note that while the tilemap is fading in or out, this will return the current alpha value, not the target alpha.



Scripting reference
Ambient sound · Camera · Candle · Display effect · Floating image · Globals · Level · Level time · Path · Platform · Player · Scripted object · Sector · Sound · Text · Thunderstorm · Tilemap · Will-o-wisp · Wind