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

Difference between revisions of "ScriptingThunderstorm"

From SuperTux
Jump to: navigation, search
m (Added link to desc of object)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
  
= Summary =
+
== Summary ==
  
 
A [[Thunderstorm]] object that was given a name can be controlled by scripts.
 
A [[Thunderstorm]] object that was given a name can be controlled by scripts.
  
= Example =
+
== Instances ==
 +
A <tt>Thunderstorm</tt> is initialised by a definition in the level. It can be accessed via its <tt>name</tt> in scripts and <tt>sector.<i>name</i></tt> in the console.
 +
 
 +
=== Example ===
  
 
Example of a definition:
 
Example of a definition:
Line 23: Line 26:
 
</pre>
 
</pre>
  
= Methods =
+
In the console:
 +
<pre>
 +
sector.ELIZA.electrify()
 +
</pre>
 +
 
 +
== Methods ==
 
{| class="objectlist"
 
{| class="objectlist"
 
! class="method"| start()
 
! class="method"| start()
Line 44: Line 52:
 
|}
 
|}
  
= Constants =
+
== Constants ==
  
 
None
 
None
  
 
[[Category:Scripting Reference]]
 
[[Category:Scripting Reference]]

Revision as of 05:56, 25 June 2007


Summary

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

Instances

A Thunderstorm is initialised by a definition in the level. It can be accessed via its name in scripts and sector.name in the console.

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();

In the console:

sector.ELIZA.electrify()

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