Alright Sorry if I am really annoying you with this btw... and Thanks so far for the help
here it is( and theres a lot of unrelated codes in there like Particles that I was just messing around with)
#include "DarkGDK.h"
#include "SC_Collision.h"
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
// dbColorBackdrop colors backdrop "slate grey"
dbSyncOn ( );
dbSyncRate ( 60 );
dbColorBackdrop ( dbRGB ( 119, 136, 153 ));
dbPrint ( "Loading..." );
dbSync ( );
dbSync ( );
int ImageNumber = 1;
// Loading Model Castel
dbLoadObject ( "Castel.x", 1 );
dbPositionObject(1, 0, -0.01, 0);
dbLoadImage ( "Fire.bmp", ImageNumber );
SC_Start ( );
SC_SetupComplexObject ( 1, 1, 2);
SC_DrawObjectBounds(1);
dbLoadObject ( "Stairs.x", 4 );
dbPositionObject(1, 0, -0.01, 0);
SC_Start ( );
SC_SetupComplexObject ( 4, 4, 2);
SC_DrawObjectBounds(4);
dbLoadObject ( "Stairs.x", 5 );
dbPositionObject(1, 0, -0.01, 0);
SC_Start ( );
SC_SetupObject ( 5, 5, 2);
SC_DrawObjectBounds(5);
// Loading Model Ladder
dbLoadObject ( "Ladder.x", 3 );
dbPositionObject(3, -1150, -0.01, 1250);
dbRotateObject(3, 0, 90, 0);
SC_Start ( );
SC_SetupObject (3, 3, 2);
SC_DrawObjectBounds(3);
dbMakeObjectCube(2, 32);
dbPositionObject(2, 0, 20, 0);
SC_SetupObject (2, 2, 2);
// Setup
dbMaximizeWindow ( );
int ParticleNumber = 1;
dbMakeParticles ( ParticleNumber, ImageNumber, 50, 100.0f );
dbPositionParticles ( ParticleNumber, -1500, 1000, 1000 );
dbColorParticles ( ParticleNumber, 255, 128, 0 );
dbSetParticleEmissions ( ParticleNumber, 10 );
dbSetParticleSpeed ( ParticleNumber, 0.05f );
dbSetParticleGravity ( ParticleNumber, 0 );
float fHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ), dbCameraPositionZ ( ) );
//repostion player
dbPositionObject ( 2, dbCameraPositionX ( ) , fHeight + 20.0f, dbCameraPositionZ ( ) +60.0f );
//Camera
dbPositionCamera ( 434, 0, -1600 );
dbPointCamera ( 0,3,400 );
// Object Settings
dbLoopObject ( 1 );
dbSetObjectSpeed ( 1, 4.0 );
/////////////////////////////////////////////////////////////////////////////////
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
float ox;
float oy;
float oz;
float oax;
float oay;
float oaz;
int iCollideID=0;
float GroundHeight(float p_x, float p_z){
int CollideObject=SC_RayCastGroup( this->sc_Group, p_x,100,p_z, p_x,-100,p_z, 0 );
if(CollideObject>0){
float newy = SC_GetStaticCollisionY();
return newy;
}else{
return 0.0f;
};
};
////////////////////////////////////////////////////////////////////////////////
while ( LoopGDK ( ) )
{
// Shows FPS
char szFPS [ 256 ] = "";
strcpy ( szFPS, "fps = " );
strcat ( szFPS, dbStr ( dbScreenFPS ( ) ) );
dbText ( dbScreenWidth ( ) - 20 - dbTextWidth ( szFPS ), dbScreenHeight ( ) - 40, szFPS );
/////////////////////////////////////////////////////////////////////////////////////////
//Particle Follow mouse
dbPositionParticleEmissions ( ParticleNumber , ( dbMouseX ( ) - 320 ) / 40.0f * 20, ( 360 - dbMouseY ( ) ) / 40.0f * 20, 10 * 20 );
if ( dbMouseClick ( ) )
{
dbColorParticles ( ParticleNumber, dbRnd ( 255 ), dbRnd ( 255 ), dbRnd ( 255 ) );
}
//////////////////////////////////////////////////////////////////////////////////
ox =dbObjectPositionX(2);
oy =dbObjectPositionY(2);
oz =dbObjectPositionZ(2);
oax =dbObjectAngleX(2);
oay =dbObjectAngleY(2);
oaz =dbObjectAngleZ(2);
// Controls Up,Down,Left,Right
if (dbUpKey() == 1)
{
dbMoveObject(2, 5.0);
}
if (dbDownKey() == 1)
{
dbMoveObject(2, -5.0);
}
if (dbLeftKey() == 1)
{
dbTurnObjectLeft(2, 5.0);
}
if (dbRightKey() == 1)
{
dbTurnObjectRight(2, 5.0);
}
int X = dbObjectPositionY(1);
int Y = dbObjectPositionY(2);
int O = dbObjectPositionY(4);
int W = Y * 2.2;
int i = Y + 2;
int dbKeyState(int SpaceKey);
int R = 0;
if (dbSpaceKey() == 1 & Y<125 & W<200 & R == 0)
{
dbMoveObjectUp(2, -Y* 2 + 200.0);
int (R = 1);
}
/////////////////////////////////////////////////////////////////////////////
SC_UpdateObject(2);
iCollideID = SC_ObjectCollision(3,2);
if(iCollideID>0)
{
dbMoveObjectUp(2, Y* 0.07 + 4);
};
if (Y<25)
{
R = 1;
}
//Collisions
SC_UpdateObject(2);
iCollideID = SC_ObjectCollision(1,2);
if(iCollideID>0)
{
dbPositionObject(2, ox, oy, oz);
dbRotateObject(2, oax, oay, oaz);
int R = 1;
}
SC_UpdateObject(2);
SC_UpdateObject(4);
iCollideID = SC_ObjectCollision(4,2);
if(iCollideID>0)
{
dbPositionObject(2, ox, Y + 15, oz);
dbRotateObject(2, oax, oay, oaz);
R = 1;
}
SC_UpdateObject(2);
iCollideID = SC_ObjectCollision(5,2);
if(iCollideID>0)
{
R = 1
}
if(R == 0)
{
dbMoveObjectUp(2, -Y * 0.07);
};
//////////////////////////////////////////////////////////////////////////////////////////////
dbPositionCamera(dbObjectPositionX(2), dbObjectPositionY(2), dbObjectPositionZ(2));
dbRotateCamera(dbObjectAngleX(2), dbObjectAngleY(2), dbObjectAngleZ(2));
dbMoveCamera(-180);
dbPitchCameraUp(90);
dbMoveCamera(40);
dbPointCamera(dbObjectPositionX(2), dbObjectPositionY(2), dbObjectPositionZ(2));
//////////////////////////////////////////////////////////////////////////////////////////////
dbSetCursor(0,0);
dbPrint( dbStr(iCollideID));
dbPrint( dbStr( Y));
dbPrint( dbStr( W));
dbSync ( );
}
// return back to windows
return;
}
Thanks in Future