In ENIGMA, an instance refers to an actual
instance, or representation, or copy, if you will, of an
object. An instance is to an object as you are to
the human species. An object can have any number of instances, each
functioning independently of one another with their own set of local
variables.
When an object is created and its behavior programmed (e.g. a bullet),
then when it is created in the game that is an instance of that object.
So when a player shoots, then every bullet is its own instance.
Every instance have built in variables that are local to the instance
itself. They are updated automatically or can be set.
*These variables are constant and cannot be changed.
- Create an instance of the specified object at the position (x,y).
- Destroys the calling instance.
- Returns whether an instance of type obj exists. obj can be an
object, an instance id, or the keyword all.
- Returns the id of the (n+1)'th instance of type obj. obj can be
an object or the keyword all.
- Returns the number of instances of type obj. obj can be an object
or the keyword all.
- Returns the id of the instance of type obj furthest away from
(x,y). obj can be an object or the keyword all.
- Returns the id of the instance of type obj nearest to (x,y). obj
can be an object or the keyword all.
- Returns the id of the instance of type obj at position (x,y).
When multiple instances are at that position the first is returned.
obj can be an object or the keyword all.
- Returns the id of the instance of type obj met when the current
instance is placed at position (x,y). obj can be an object or the
keyword all.