This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.

ScriptingThunderstorm

From SuperTux
Revision as of 17:55, 12 July 2006 by 195.158.179.251 (Talk)

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


Summary

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

Example

Example of a definition:

(thunderstorm
  (name "ELIZA")
  (running #f)
)

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

ELIZA.thunder();
wait(2);
ELIZA.lightning();

Methods

start() Start playing thunder and lightning at configured interval
stop() Stop playing thunder and lightning at configured interval
thunder() Play thunder
lightning() Play lightning, i.e. call flash() and electrify()
flash() Display a nice flash
electrify() Electrify water throughout the whole sector for a short time

Constants

None