I have the code
#include "DarkGDK.h"
#include "SC_Collision.h"
#include "KeyID's.h"
//Setup all the gravity and jumping things
int IJump=1;
bool BJump = false;
int IGravityPull=1;
bool BGravity = false;
bool BGround = false;
void WhileLoops();
void Input();
void Collision();
void OldPosition();
int Ox = dbCameraPositionX (0);
int Oy = dbCameraPositionY (0)+1;
int Oz = dbCameraPositionZ (0);
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 5 );
SC_Start ();
//Load the map
dbLoadObject ( "TunnelMap.x", 1 );
SC_SetupObject ( 1, 1, 0 );
dbScaleObject ( 1, 100.0f, 100.0f, 100.0f );
//Load You
dbLoadObject ( "shotgun.x", 2 );
SC_SetupObject ( 2, 2, 0 );
dbPositionObject ( 2, 0.0f, 1.0f, 0.5f );
while ( LoopGDK ( ) )
{
dbText ( dbScreenWidth()/2, dbScreenHeight()/2, "Works");
//Position You and Lock the Gun
dbLockObjectOn ( 2 );
dbControlCameraUsingArrowKeys (0, 1.0f, 1.0f );
//Gravity and Jumping
Input();
WhileLoops();
Collision();
dbSync ( );
}
}
void Input()
{
if (dbKeyState (SpaceKey == 1) )
{
if (BGravity == false )
{
BJump = true;
}
}
}
void WhileLoops()
{
while ( BJump == true)
{
dbMoveCameraUp (0, IJump );
IJump = IJump+1;
if ( IJump == 10 ){
BJump = false;
BGravity = true;
IJump = 1;
}
}
while ( BGravity == true )
{
dbMoveCameraDown (0, IGravityPull );
if ( BGround == true )
{
BGravity = false;
}
}
while ( BGround == true )
{
dbPositionCamera ( Ox, Oy, Oz );
BGravity = false;
}
}
void Collision()
{
if (SC_GroupCollision ( 2, 1 ))
{
BGround = true;
}
SC_UpdateObject ( 2 );
}
When I debug it, it take FOREVER to load, and usually I don't have enough patients.
Is there a way of speeding up the process?
Global Warfare