here is the code:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
int Sid = 1;
int Sx [100];
int Sz [100];
int Sg [100];
int SBo;
int SRo;
int Sm;
Sm = 2;
int Sa [100];
Sg[1] = 0;
Sg[2] = 1;
int Setup = 1;
dbSetAmbientLight ( 0 );
dbRandomize ( 9 );
dbMakeObjectCube (201, 100);
dbPositionObject (201, 0, 0, 0);
dbScaleObject (201, 1000, 0.5, 1000);
dbColorObject (201, dbRGB ( 0, 0, 0 ));
dbMakeObjectCube (202, 100);
dbPositionObject (202, 500, 0, 0);
dbScaleObject (202, 40, 50, 1000);
dbMakeObjectCube (203, 100);
dbPositionObject (203, -500, 0, 0);
dbScaleObject (203, 40, 50, 1000);
dbMakeObjectCube (204, 100);
dbPositionObject (204, 0, 0, 500 );
dbScaleObject (204, 1040, 50, 40);
dbMakeObjectCube (205, 100);
dbPositionObject (205, 0, 0, -500 );
dbScaleObject (205, 1040, 50, 40);
while ( LoopGDK ( ) ) {
dbPositionCamera ( 0, 1000, 0 );
dbPointCamera ( 0, 0, 0 );
// Make initial spheres
if (Setup == 1) {
if (Sid <= 2) {
SBo = 0;
SRo = 0;
Sx[Sid] = dbRND ( 500 );
Sz[Sid] = dbRND ( 500 );
Sa[Sid] = dbRND ( 360 );
dbMakeObjectSphere ( Sid, 50 );
dbPositionObject ( Sid, Sx[Sid], 0, Sz[Sid] );
dbYRotateObject ( Sid, Sa[Sid] );
if (Sg[Sid] == 0){SRo = 1000;}
if (Sg[Sid] == 1){SBo = 1000;}
dbColorObject ( Sid, dbRGB ( SRo, 0, SBo ));
Sid = Sid + 1;
Sm = Sm + 1;
}}
if (Sid > 2) {
Setup = 0;
Sm = 2;
Sid = 1;
}
// Make initial spheres
//////////////////////////////////////////////////////////////////////////////////////
// Run the spheres
if ( Setup == 0 ) {
if (Sid <= Sm) {
dbMoveObject ( Sid, 20 );
if (dbObjectCollision ( Sid, 202 )) {
Sa [Sid] = Sa [Sid] - (Sa [Sid] * 2);
dbYRotateObject ( Sid, Sa[Sid] );
dbMoveObject ( Sid, 10 );
}
if (dbObjectCollision ( Sid, 203 )) {
Sa [Sid] = Sa [Sid] - (Sa [Sid] * 2);
dbYRotateObject ( Sid, Sa[Sid] );
dbMoveObject ( Sid, 10 );
}
if (dbObjectCollision ( Sid, 204 )) {
Sa [Sid] = Sa [Sid] + (Sa [Sid] * 2) + 90;
dbYRotateObject ( Sid, Sa[Sid] );
dbMoveObject ( Sid, 10 );
}
if (dbObjectCollision ( Sid, 205 )) {
Sa [Sid] = Sa [Sid] + (Sa [Sid] * 2) + 90;
dbYRotateObject ( Sid, Sa[Sid] );
dbMoveObject ( Sid, 10 );
}
Sid = Sid + 1;
}}
if (Sid > Sm) {
Sid = 1;
}
dbSync();
}
return;
}
True geeks live forever, or die trying.