| Objects are the main part of a game; they interact with the player and show information.
There are several default objects you can use with JAM, including Active objects, Counters and Text. Aditional objects can also be made, extending JAM's features.
All objects have some features in common, such as physical position and size, and ink effect, etc. These features are shown in the Common Functions section.
Putting an object on the screen involves two steps:
| | | | |
oJAM = New JAM( );
MyFrame1 = oJAM.Storyboard.NewFrame( Startup1, Code1, End1 );
oJAM.Run( );
Function Startup1( )
{
This.classActive = New Object_Active( );
This.oCharacter = oJAM.Create( classActive, 100, 100 );
}
Function Code1( ){ }
Function End1( ){ }
| | | |
This code will create a blank active object class, then create an instance of it at 100,100 on the screen. You can make as many instances of the same class as you like.
Note the use of This. before the names. Using This. will make the value global to all JAM functions (i.e. Startup1, Code1 and End1 in this example). If you ommit This. when you declair a value within a function, it will not be accessable from other functions later.
In this example, the active object created is empty. This is proabably not what you want, so look at the Active object and general functions reference to find out how to add animations, directions, movements and more.
JAM © 2005 no one in particular Project started by David Evans in 2005 | |