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)
distance | 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.
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);