home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Zone
/
VRZONE.ISO
/
mac
/
PC
/
MISC3D
/
EEDEMO
/
TEST1.BOB
< prev
next >
Wrap
Text File
|
1993-08-11
|
1KB
|
55 lines
// a Non-Object Oriented example. It has to use Global variables for any
// state information that needs to be saved between frames.
spinner()
{
Rotate( 0, -15, 0 );
}
c6spinner()
{
Rotate( 0, 25, 0 );
if( c6Frames++ == 30 ) {
DeleteTask( c6tsk );
c6tsk = ScheduleTask(nil,"c6", "c6mover", 30);
c6Frames = 0;
}
}
c6mover()
{
if(c6Frames++ == 100) {
DeleteTask( c6tsk );
c6tsk = ScheduleTask(nil,"c6", "c6spinner", 30);
c6x *= -1;
c6Frames = 0;
}
Move( c6x, 0, 0 );
}
moveit()
{
if((nFrame % 30) == 0)
dy *= -1;
if((nFrame++ % 20) == 0)
dx *= -1;
Move( dx, dy, dz );
}
main()
{
dx = 160;
dy = 10; //move up
dz = 0;
nFrame = 0; //no of times moveit is called
c6Frames = 0; //no of times c6 is activated
c6x = 50;
ScheduleTask(0, "cone1", "moveit", 20);
ScheduleTask(0, "mh", "spinner", 30);
//save the task handle so we can re-schedule it later
c6tsk = ScheduleTask(0,"c6", "c6spinner", 100);
}