Hey guys! I'm back with more problems! Sorry! D:
For some reason, my keyboard inputs aren't being picked up. I've done everything the same as sample projects, but it isn't working. I've attached my code, there isn't much.
#include "DarkGDK.h"
float cameraDistance = 100;
float cameraFOV = 90;
float shipSpeed = 0;
float shipAcceleration = 1;
void userInput ( void );
void DarkGDK ( void )
{
dbMakeCamera ( 10000 );
dbSetDir ( "media\\" );
dbAutoCamOff ( );
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetCameraRange ( 10000, 0.05, 10000 );
dbLoadObject ( "skies\\ss.x", 3000 );
dbLoadObject ( "models\\ship01\\ship01d3d.x", 1000 );
dbLoadImage ( "models\\ship01\\ship01tex.jpg", 2000 );
dbTextureObject ( 1000, 2000 );
dbSetObjectLight ( 1000, 1 );
dbPositionObject ( 1000, 0, 0, 0 );
dbScaleObject ( 1000, 25, 25, 25 );
//Main loop!
while ( LoopGDK ( ) )
{
if ( dbEscapeKey ( ) )
return;
dbPositionMouse ( dbScreenWidth ( ) / 2, dbScreenHeight ( ) /2 );
dbSetCameraFOV ( 10000, cameraFOV );
if ( dbUpKey ( ) ) {
cameraFOV += 1;
}
if ( dbDownKey ( ) ) {
cameraFOV -= 1;
}
dbMoveObject ( 1000, 1 );
dbXRotateObject ( 1000, dbObjectAngleX ( 1000 ) + dbMouseMoveY ( ) * -0.5 );
dbYRotateObject ( 1000, dbObjectAngleY ( 1000 ) + dbMouseMoveX ( ) * 0.25 );
dbZRotateObject ( 1000, dbObjectAngleZ ( 1000 ) + dbMouseMoveX ( ) * 0.25 );
dbMoveObject ( 1000, shipSpeed );
dbSetCameraToObjectOrientation ( 10000, 1000 );
dbMoveCamera ( 10000, -cameraDistance );
dbPitchCameraUp ( 10000, 90 );
dbMoveCamera ( 10000, 20 );
dbPitchCameraDown ( 10000, 90 );
dbText ( 16, 16, dbStr ( dbScanCode ( ) ) );
dbSync ( );
dbPositionCamera ( 10000, dbObjectPositionX ( 1000 ), dbObjectPositionY ( 1000 ), dbObjectPositionZ ( 1000 ) );
}
}
void userInput ( void )
{
if ( dbKeyState ( 17 ) == 1 )
{
shipSpeed = shipSpeed + shipAcceleration;
}
}