This command makes a 3D object move in response to the arrow keys.

 object.Walk(Player,WalkSpeed,StrafeSpeed,RotateSpeed,             RunFactor) 



Player number (1,2, 3, and so on). For use with the GameInput command.


Speed at which the forward or backward motion will occur.


Strafe speed.


Speed for rotation in radians per second.


Multiplier factor between walking and running.


This command uses the arrow keys to move the object. The left and right arrow keys rotate the object about its y-axis, while the up and arrow keys move it forward or back (the direction of motion depends on which way the object is pointing).

This is a very easy way to make an object move through a 3D world.

Sample Code

 oworld = New World(); ocamera = New Camera(oworld); sphere = oworld.CreateSphere(50,50,50,25,25); ocamera.MoveBack(1200); sphere.Walk(); //loop While(TRUE);23 

Elementary Game Programming and Simulators Using Jamagic
Elementary Game Programming & Simulations Using Jamagic (Charles River Media Game Development)
ISBN: 1584502614
EAN: 2147483647
Year: 2002
Pages: 105
Authors: Sergio Perez

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net