With a little bit of your help, and determination, I was able to get it working. THANK YOU J_C for the little tip that head me in the right direction.
I've included my code in case anyone has the same problem I did!
#include "DarkGDK.h"
#include "SC_Collision.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetWindowOff ( );
dbHideMouse ( );
dbSetDisplayMode (1024, 768, 32);
dbLoadMusic("sounds/shot.mp3", 1);
dbLoadMusic("sounds/reload.mp3", 2);
dbColorBackdrop( dbRGB(0,0,0) );
dbAutoCamOff();
dbLoadObject ("maps/box.dbo", 1);
dbSetObjectLight ( 1, 0 );
SC_Start();
SC_SetupObject ( 1, 0, 0);
dbPositionCamera ( -250, 100, -5);
// DUMMY PLAYER
dbMakeObjectBox (2,40,100,40);
dbPositionObject (2, -250, 82, 30);
SC_SetupObject (2, 0, 0);
// YOUR CHARACTER
dbMakeObjectBox (3,40,100,40);
dbPositionObject (3, -250, 82, -5);
dbHideObject(3);
SC_SetupObject (3, 0, 0);
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
int ammo;
int collide = 0;
float ax;
float az;
float oldx;
float oldz;
ammo = 20;
// our main loop
while ( LoopGDK ( ) )
{
oldx = dbCameraPositionX();
oldz = dbCameraPositionZ();
// move the camera using the arrow keys
dbControlCameraUsingArrowKeys ( 0, 5.0f, 0.3f );
// create a rotation axis based on mouse movement
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.4f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.4f );
SC_UpdateObject(3);
ax = dbCameraPositionX();
az = dbCameraPositionZ();
collide = SC_SphereSlide( 0, oldx,100.0f,oldz, ax,100.0f,az, 20.0f, 3 );
if (collide > 0){
dbText ((dbScreenWidth()/2)-45, (dbScreenHeight()/2) -25, "COLLISION!");
dbPositionObject(3, SC_GetCollisionSlideX(),SC_GetCollisionSlideY(),SC_GetCollisionSlideZ() );
dbPositionCamera(SC_GetCollisionSlideX(),SC_GetCollisionSlideY(),SC_GetCollisionSlideZ());
} else {
dbPositionCamera ( ax, 100.0f, az);
dbPositionObject ( 3, ax, 100.0f, az);
}
dbText(200,200,dbStr(ax));
dbText(200,225,dbStr(az));
// rotate camera
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
dbSetTextFont("Arial");
dbSetTextSize(20);
dbText(dbScreenWidth()/2,dbScreenHeight()/2,"+");
dbText(0,0,dbStr(ammo));
if (ammo == 0){
dbText((dbScreenWidth()/2)-50,(dbScreenHeight()/2) - 50,"Reload Ammo!");
}
// bullet code
int mouseClick = dbMouseClick();
int mousePressed;
if (mouseClick == 1) {
mousePressed = mousePressed + 1;
if (mousePressed == 1){
if (ammo > 0){
ammo = ammo - 1;
dbPlayMusic(1);
}
}
}
if (mouseClick == 2) {
ammo = 20;
dbPlayMusic(2);
}
if (mouseClick == 0) {
mousePressed = 0;
int musicShotPlaying = dbMusicPlaying(1);
if (musicShotPlaying == 0){
dbStopMusic(1);
}
int musicReloadPlaying = dbMusicPlaying(2);
if (musicReloadPlaying == 0){
dbStopMusic(2);
}
}
// display location
dbText(dbScreenWidth()/2, 0, dbStr(dbCameraPositionX ( )));
dbText(dbScreenWidth()/2, 20, dbStr(dbCameraPositionY ( )));
dbText(dbScreenWidth()/2, 40, dbStr(dbCameraPositionZ ( )));
// update screen
dbSync ( );
}
// return back to windows
return;
}