ScriptingWind

From SuperTux

Jump to: navigation, search


[edit] Summary

A Wind object that was given a name can be controlled by scripts.

[edit] Instances

A Wind is instantiated by a definition in the level file. It can be accessed by scripts using its name and from the console as sector.name.

[edit] Example

Example of a definition:

(wind
  (name "WIND1")
  (blowing #f)
  (speed-x 0)
  (speed-y -600)
  (acceleration 3)
  (width 32)
  (height 64)
  (x 783)
  (y 768)
)

The above object will be exposed under the name WIND1 in the scripting engine. Example usage:

WIND1.start();

Console access:

sector.WIND1.stop()

[edit] Methods

start() start blowing
stop() stop blowing

[edit] Constants

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
Personal tools