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

Difference between revisions of "ScriptingWind"

From SuperTux
Jump to: navigation, search
(Created wind page)
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
  
= Summary =
+
== Summary ==
  
 
A Wind object that was given a name can be controlled by scripts.
 
A Wind object that was given a name can be controlled by scripts.
  
= Example =
+
== Instances ==
 +
A <tt>Wind</tt> is instantiated by a definition in the level file. It can be accessed by scripts using its <tt>name</tt> and from the console as <tt>sector.<i>name</i></tt>.
 +
 
 +
=== Example ===
  
 
Example of a definition:
 
Example of a definition:
Line 28: Line 31:
 
</pre>
 
</pre>
  
= Methods =
+
Console access:
 +
<pre>
 +
sector.WIND1.stop()
 +
</pre>
 +
 
 +
== Methods ==
 
{| class="objectlist"
 
{| class="objectlist"
 
! class="method"| start()
 
! class="method"| start()
Line 37: Line 45:
 
|}
 
|}
  
= Constants =
+
== Constants ==
  
 
None
 
None
  
 
[[Category:Scripting Reference]]
 
[[Category:Scripting Reference]]

Revision as of 04:52, 25 June 2007


Summary

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

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.

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

Methods

start() start blowing
stop() stop blowing

Constants

None