SetStatic


This command makes an object a static object.

 object.SetStatic() 

Notes

This is an important command for objects that will not move (for example, background objects). By designating an object as a static object, you are saving the computer work because it automatically knows not to check for motion. In this way, you can speed up the execution of your game.

The Optimize command must be used after the SetStatic command in order to for the SetStatic command to take effect.

Sample Code

 oworld = New World(); ocamera = New Camera(oworld); sphere = oworld.CreateSphere(50,50,50,25,25); sphere.SetPosition(0,200,0); mats = New Material(oworld,,RED,"mats"); sphere.SetGouraud(); sphere.ReplaceMaterial(mats); plane = oworld.CreatePlane(600,600); Matplane = New Material(oworld, ,GREEN, "Matplane"); matplane.SetFlat; plane.ReplaceMaterial(matplane); plane.SetAngle(-Pi/2,0,0); plane.SetStatic(); oworld.Optimize(ocamera); ocamera.MoveBack(1200); ocamera.MoveUp(200); sphere.Walk(); sphere.SetShadowMode(Object.SHADOW_MODE_TRUE); sphere.EnableShadow(); //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

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