You can define you own classes, which can then be used to make new instances of those objects. Class definitions are made using the 'class' keyword, and end with 'end'.
// a class with no methods
// creates an instance of Person
person = new Person()
Once a class is defined, instances of the class are created using the 'new' keyword, like above.
* A simple Sprite class, which can be moved.
// accessors for x/y fields
getset( x, y )
// getter only, no setter
get( image )
* Constructor, takes a starting x/y location, and image.
def new( x, y, image )
@x = x
@y = y
@image = image
* Moves the Sprite by the amount given.
def move( x, y )
@x = @x + x
@y = @y + y
* Draws this sprite at it's current location, centred.
drawImage( @image, @x, @y, true )