MPUZ: Functions

From Mario Fan Games Galaxy Wiki
Revision as of 04:13, 26 November 2008 by Xgoff (talk | contribs)
This information is subject to change.
MPUZ
Mpuz logo.png
Development Main Page
Basics
Intermediate
Advanced
  • none
Reference
[Edit]


The following is a list of functions and keywords used by MPUZ's engine.

Keywords and Global Variables

  • me: the reference to the object currently having its script executed. For example, an object may use me.x within its script to retrieve its x position. For a breakdown of the variables contained in the object structure, check out MPUZ: Object Variables.
  • id: the current object's sysid; in fact, this variable is exactly the same as using me.sysid.
  • pi: i was nice enough to provide this so you could save the effort of typing math.pi.
  • eps: 'epsilon', basically a small number which is used to make floating-point comparisons a little more reliable. Basically, instead of doing x == y, you'll do abs(x - y) < eps. By default, it's .0001 (or close enough to).
  • fps: returns the current fps.
  • basefps: returns the 'ideal' fps, which is set in the game options.
  • timer: the in-game clock, if it is being used in the level
  • counter: incremented by 1 each time the main loop finishes; ie. it's tied to the framerate.

Functions