Initializing Objects
In order to initialize a screen object you must follow these steps:
- Animate the Object. This is done using the animate.obj command. This tells the interpreter that you want to use this
object. There are a limited number of objects that the interpreter can use at any one time. This is set by a certain byte in the OBJECT file. There is currently no program that will edit this,
but the template game allows for up to 16 objects (0-15) which should be enough. Also, the more objects you use the slower the interpreter will run, but it is not really noticeable on today's machines.
- Assign a view to the object. This is done using the set.view command. Each object must have a view assigned to it, and
this is the view that is displayed on the screen wherever the object is. One view can be assigned to multiple screen objects. You must have the view loaded in memory before you assign it. This
can be done with the load.view command.
- Position the object on screen. This is done using the position command.
- Draw the object. This is done using the draw command. If you do not do this the object will not be visible on screen.
Here is an example:
animate.obj(o2);
load.view(4);
set.view(o2,4);
position(o2,80,120);
draw(o2);
This will result in an animation of view 4 being displayed at 80,120.
See also
Objects