This command causes one object to move randomly about another object. Using this command is a very good way to make a simple game of collision avoidance .

 object.MoveAround(Other3DObject, distance, minx, miny, minz,                   maxx, maxy, maxz, incx, incy, incz) 



The distance between the two objects as the motion occurs.

minx , miny , and minz values

Refer to the minimum angles about each axis that the object will move about the other object.

maxx , maxy , and maxz parameters

Refer to the maximum angles between the objects.

incx , incy , and incz parameters

Refer to the value that is to be added in every loop around the object to the x, y, or z angles.


This command provides a simple way to make a game of collision avoidance. For example, with the MoveAround command, you can make an object move randomly about a fortress, and you can try to get through without crashing into the object.

Sample Code

 oworld = New World(); ocamera = New Camera(oworld); sphere = oworld.CreateSphere(50,50,50,25,25); //Create a brick. brick1 = oworld.CreateBrick(10,10,10); ocamera.MoveBack(1200); //Move the sphere with the arrow keys. sphere.Walk(); // Brick moves around the sphere. brick1.MoveAround(sphere,100); //Loop While(TRUE); 

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 © 2008-2017.
If you may any questions please contact us: