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

Difference between revisions of "ScriptingPlatform"

From SuperTux
Jump to: navigation, search
 
(cat)
Line 48: Line 48:
  
 
None
 
None
 +
 +
[[Category:Scripting Reference]]

Revision as of 00:40, 28 June 2006


Summary

A Moving platform that was given a name can be controlled by scripts.

Example

Example of a definition:

  (platform
    (name "PLATFORM1")
    (running #f)
    (sprite "images/objects/platforms/vertical-wood.sprite")
    (path
      (mode "circular")
      (node
        (x 832)
        (y 800)
      )
      (node
        (x 832)
        (y 704)
      )
    )
  ) 
 

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

  PLATFORM1.goto_node(0);
 

Methods

goto_node(int node_no) advance until at given node, then stop.
start_moving() start advancing automatically
stop_moving() stop advancing automatically

Constants

None