This wiki has been moved to into the mediawiki branch.


From SuperTux
Revision as of 11:18, 23 January 2010 by Octo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


An ambient sound that was given a name can be controlled by scripts.


An AmbientSound is instantiated by placing a definition inside a level. It can then be accessed by its name from a script or via from the console.


In the level file:

  (name "niagara")
  (x 10)
  (y 20)
  (width 100)
  (height 51)
  (distance_factor 0.5)
  (distance_bias 0)
  (sample "waterfall.wav")
  (volume 1)

In a script:

niagara.set_pos(0, 0);

In the console:

sector.niagara.set_pos(18, 35)


set_pos(float x, float y) Sets the position of the ambient sound
get_pos_x() Returns the x coordinate.
get_pos_y() Returns the y coordinate.


  • None
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