MPUZ: Functions

From Mario Fan Games Galaxy Wiki
Revision as of 22:24, 3 December 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). However, you should avoid floating-point comparisons whenever possible.
  • 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; if it isn't, it's false. Counts down by one approximately every real second.
  • timertick: increments by 1 each time the main loop finishes, and wraps around back to 0 when it equals fps; at that point, it decrements timer by 1.
  • counter: incremented by 1 each time the main loop finishes; ie. it's tied to the framerate. It does not wrap at a certain point, but continues counting.

Functions

Game

Level

Object

HUD

to be expanded