K So, evreything else works fine enough, but not the forward and back commands, they used to, and I havn't changed them to my knowlege, this is a build off of the terrain example.
#include "DarkGDK.h"
#include "DarkSDK.h"
void DarkGDK ( void )
{
dbMaximizeWindow( );/////////////////window controls
dbEnableEscapeKey ( );
dbSetWindowTitle ("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!MAZE LANDS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
dbSyncRate ( 60 );
dbSync ();
// we are going to use a skybox
dbSetCameraRange ( 1.0f, 30000.0f );
dbLoadImage ( "texture.jpg", 1 );//////////Terrain color texture
dbLoadImage ( "lava.jpg", 2 ,0);
// the first step in creating a terrain
dbSetupTerrain ( );
dbMakeObjectTerrain ( 1 );
dbSetTerrainHeightMap ( 1, "haze.jpg" );
dbSetTerrainScale ( 1, 5.0f, 2.0f, 5.0f );
dbSetTerrainLight ( 1, -.25f, .44f, -0.25f, 1.f, 1.0f, 1.0f, 1.0f ); //the last parameter is overall influence originally set to .5
dbSetTerrainTexture ( 1, 1, 2 );
dbBuildTerrain ( 1 );
dbPositionObject (1,-2500,0,-2000);/////////////////////////terrain
dbSetObjectTexture ( 1, 3, 2 );
float oheight = dbGetTerrainGroundHeight (1, dbObjectPositionX (11 ), dbObjectPositionY(11));
//dbAutomaticCameraCollision (1, 1.0f, 1 );
float fHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ), dbCameraPositionY ( ));
// with the terrain in place we can now load a skybox
dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );/////////////////////////////////////skybox
dbSetObjectTexture(2, 3, 2);
dbScaleObject ( 2, 10000.0f, 10000.0f, 10000.0f );
//dbMakeObjectBox ( 4, 100, 600, 200 );
//dbPositionObject (4, 500, 0, 500); /////////////////////mirror box
//dbSetObjectTexture(4, 1, 2); ///// not currently in use
//dbSetReflectionShadingOn (4 ) ;
dbLoadObject ("Colonel-X.x", 11 );
dbPositionCamera ( 180 ,180, 180 );
dbPositionObject (11, 15, oheight ,15);
dbSetObjectLight (11, 1);
dbLoopObject ( 11, 288, 315 );/////////////////////////////////colonel x
dbSetObjectSpeed ( 11, 120 );
dbScaleObject (11, 150.0f, 150.0f, 150.0f);
//dbSetObjectRadius ( 11, 15 ) ;
//dbAutomaticObjectCollision ( 11, 5, 1 ) ;
while ( LoopGDK ( ) ) ///////////////////////////////////////////loop gdk
{
fHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ),dbCameraPositionY ( ));
oheight = dbGetTerrainGroundHeight (1, dbObjectPositionX (11 ), dbObjectPositionY(11)); /////////character height
float fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.35f );
float fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.35f ); ///camera movement settings
if (dbKeyState (17)==1) ////////////w//////////////////////////////keystate walk
dbMoveObject (11,-10.0f);
if (dbKeyState (31)==1) //w////////////////////////////////////////Keystate walk reverse
dbMoveObject (11, 10.0f);
if (dbKeyState (30)==1) //a////////////////////////////////////////Keystate walk left
dbMoveObjectLeft (11,-11.0f);
if (dbKeyState (32)==1) //d////////////////////////////////////////Keystate walk right
dbMoveObjectRight (11,-11.0f);
if (dbKeyState (18)==1) //e////////////////////////////////////////Keystate jump
{
dbMoveObjectUp (11, 33.0f); dbWait (8); dbMoveObject (11, -10.0f);
dbMoveObjectUp (11, 33.0f); dbWait (10); dbMoveObjectDown(11, 33.0f); dbWait (8);/////////jump code
dbMoveObject (11, -10.0f); dbMoveObjectDown(11, 33.0f); dbMoveObject (11, -10.0f);
}
dbSync ( );
dbPositionObject (11, dbObjectPositionX (11 ) ,oheight, dbObjectPositionY (11));/// ensure object is on the ground
dbControlCameraUsingArrowKeys (0,+10.0f,+10.0f ); ///moves camera about
dbSetObjectToCameraOrientation ( 11 ); //make sure colonel x is facing the camera
dbRotateObject (11, 0, 180, 0); ///////turn colonel x 180 degrees so he is facing away
dbUpdateTerrain ( );
dbSync ( );
while (dbMouseClick( ) == 1)
{
fHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ), dbCameraPositionZ ( ));
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.35f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.35f );
dbControlCameraUsingArrowKeys (0, 10.0f, 10.0f );
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
dbPositionCamera (dbCameraPositionX ( ),dbCameraPositionY ( ),dbCameraPositionZ( ));
dbRotateCamera ( dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.35f )
,dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.35f ) ,0 );
dbPositionObject (11, dbObjectPositionX ( 11) ,oheight, dbObjectPositionY (11));
dbSetObjectToCameraOrientation ( 11 );
dbRotateObject (11,0,180,0);
dbUpdateTerrain ( );
dbSync( );
}//end mouseclick 1 brace
while (dbMouseClick() == 2)
{
fHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ),dbCameraPositionY ( ) );;
dbSetCameraToObjectOrientation(11);
dbControlCameraUsingArrowKeys (0, 10.0f, 10.0f );
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.35f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.35f );
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
dbRotateCamera ( dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.35f )
,dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.35f ) ,0 );
dbPositionObject (11, dbMouseX( ), fHeight ,dbMouseY( ) );
dbPositionObject(11, dbObjectPositionX ( 11 ), oheight , dbObjectPositionY ( 11 ) );
dbPointObject (11,dbCameraPositionX( )+(dbMouseMoveX ( )* 20), 0 ,dbCameraPositionY( )+(dbMouseMoveY( ) *.09) );
dbUpdateTerrain ( );
dbSync( );
}//end mouseclick2 brace
}//end loop gdk brace
}//end Dark gdk
Thanks for any advice!
If you're not livin', you're already dead!