Movements
All objects can have a movement which provides automatic interaction with player inputs.

Attaching a movement to an object involves 2 steps:

oJAM = New JAM( );

// Set up the frames:
MyFrame1 = oJAM.Storyboard.NewFrame( Startup1, Code1, End1 );

oJAM.Run( );

// First frame:
Function Startup1( )
{
	// Here's the important code:
	
	// Step1: Create the movement class
	This.mov8Dir = New Movement_8Dir( );
	
	// Create the object to apply it to
	This.classActive = New Object_Active( );
	This.oCharacter = oJAM.Create( classActive, 100, 100 );
	
	// Step2: Apply the movement
	oCharacter.SetMovement( mov8Dir );
}
Function Code1( ){ }
Function End1( ){ }


This code will create an active object at 100,100 and apply an 8 direction movement. This means that when the player uses the arrow keys / joystick / mouse the object will move around the screen.

You can also use object.SetPlayer( 1 / 2 / 3 / 4 ) to change the controlling player.



JAM © 2005 no one in particular
Project started by David Evans in 2005