alright heres the most recent main cpp
/*created by Pulse game Studios
Pulse Game Studios does not claim any connection to or ownership of the original Nazi Zombies application fetured in call of Duty World at War
Creation date 1/9/2010
Last updated 2/1/2010
*/
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
int dummy;
int Score = 1000;
//these integers are directly relative the player
int GunInt = 0;
bool WeaponActive = false;
float fCameraAngleY;
float fCameraAngleX;
float OldCamAngleX;
float OldCamAngleY;
//this is our main function
void DarkGDK ( void )
{
//this command sets the maximum sync rate for updating the items of the screen
dbSyncOn ( );
dbSyncRate ( 60 );
//these integers are used to test for activation of certain objects such as doors and the random box
int dummy2;
int boxantiloop = 0;
bool door1antiloop = true;
bool door2antiloop = true;
bool switch1antiloop = true;
bool switch2antiloop = true;
bool lockdoorantiloop = true;
//this command loads and positions the 3d world
dbLoadObject ("Outpost.x",20);
dbPositionObject (20,0,-85,-1920);
dbSetObjectCollisionToPolygons (20);
//these commands load and positio the skybox
dbLoadObject ("skybox2.x",112);
dbSetObjectTexture (112,1,1);
dbScaleObject (112,30000,30000,30000);
dbSetObjectLight (112,0);
dbPositionObject (112,0,0,0);
dbBackdropOff ();
dbSetObjectCollisionOff (112);
//this command loads and positions the random box .x file
dbLoadObject ("large box.x",100);
dbSetObjectCollisionToBoxes (100);
dbLoadObject ("large box lid.x",200);
dbPositionObject (200,2,22,33);
dbSetObjectCollisionToBoxes (200);
//these commands generate the switch used for power
dbLoadObject ("switch.x",500);
dbPositionObject (500,-275,-50,-500);
dbScaleObject (500,50,100,150);
dbYRotateObject (500,90);
dbSetObjectCollisionToBoxes (500);
//this command loads one of the doors for use in our game
dbLoadObject ("Bulkhead.x",21);
dbRotateObject (21,0,90,0);
dbScaleObject (21,150,150,150);
dbPositionObject (21,600,-50,-2044);
dbSetObjectCollisionToBoxes (21);
dbLoadObject ("Bulkhead.x",22);
dbRotateObject (22,0,270,0);
dbScaleObject (22,150,150,150);
dbPositionObject (22,-580,-50,-2044);
dbSetObjectCollisionToBoxes (22);
dbLoadObject ("Window Frame.x",501);
dbPositionObject (501,1034,128,-2515);
dbRotateObject (501,0,90,0);
dbScaleObject (501,155,140,170);
dbSetObjectCollisionToBoxes (501);
dbLoadObject ("Window Barrier.x",502);
dbPositionObject (502,1038,150,-2515);
dbRotateObject (502,0,90,0);
dbScaleObject (502,155,140,170);
dbSetObjectCollisionOff (502);
dbLoadObject ("Window Barrier.x",503);
dbPositionObject (503,1038,120,-2515);
dbRotateObject (503,0,90,0);
dbScaleObject (503,155,140,170);
dbSetObjectCollisionOff (503);
dbLoadObject ("Window Barrier.x",504);
dbPositionObject (504,1038,83,-2515);
dbRotateObject (504,0,90,0);
dbScaleObject (504,155,140,170);
dbSetObjectCollisionOff (504);
dbLoadObject ("Window Barrier.x",505);
dbPositionObject (505,1038,43,-2515);
dbRotateObject (505,0,90,0);
dbScaleObject (505,155,140,170);
dbSetObjectCollisionOff (505);
dbMakeLight (1);
dbPositionLight (1,0,0,0);
dbColorLight (1,30,100,10);
//this command is supposed to re-color the backdrop even though it doesnt seem to be working
dbBackdropColor(0);
//this makes and positions the the camera used in the program
dbSetCameraRange (1,30000);
dbPositionCamera (0,100,-2700);
dbAutoCamOff();
dbAutomaticCameraCollision (0,8,5);
dbDeleteImage (47);
//this is the main loop
while ( LoopGDK ( ) )
{
//this command allows the player/camera to move about the screen
dbControlCameraUsingArrowKeys (0,8,3);
if (dbKeyState(17) == 1)
{
dbMoveCamera(0,8);
};
if (dbKeyState(31) == 1)
{
dbMoveCamera (0,-8);
};
if (dbKeyState(30) == 1 )
{
dbMoveCameraLeft (0,5);
};
if (dbKeyState(32) == 1)
{
dbMoveCameraRight (0,5);
};
OldCamAngleX = dbCameraAngleX ();
OldCamAngleY = dbCameraAngleY ();
fCameraAngleY = dbWrapValue ( ( dbCameraAngleY ( 0 ) + dbMouseMoveX ( ) * 0.4f ) );
dbYRotateCamera ( 0 , dbCurveAngle ( fCameraAngleY , OldCamAngleY , 6 ) );
dbPositionCamera ( 0 , dbCameraPositionX ( 0 ) , 100 , dbCameraPositionZ ( 0 ) );
dbHideMouse ();
//these commands gets the position of the camera and places the values into three integers for later use
float camx = dbCameraPositionX ();
float camy = dbCameraPositionY ();
float camz = dbCameraPositionZ ();
//this if tests to see if the player is in range of the box and if the box is already open
if (boxantiloop ==0 && 220 >= camx && -220 <= camx && 101 >= camy && -101 <= camy && 110 >= camz && -110 <= camz)
{
dbText (5,465,"Hold F To Buy Box (950)");
//this command tests for the space keys activation and then opens the box and positions the earlier hidden gun
if (dbKeyState(33)==1 && Score >= 950)
{
dbRandomize ( dbTimer ( ) );
GunInt = dbRND ( 19 );
Score -= 950;
dbXRotateObject (200,83);
boxantiloop++;
if (GunInt == 0)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 1)
{
dbLoadObject ("PPSH-41.x",GunInt);
WeaponActive = true;
dbPositionObject (GunInt,20,80,5);
};
if (GunInt == 2)
{
dbLoadObject ("PPSH-41.x",GunInt);
WeaponActive = true;
dbPositionObject (GunInt,20,80,5);
};
if (GunInt == 3)
{
dbLoadObject ("MP40.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,170,170,170);
dbPositionObject (GunInt,20,80,0);
};
if (GunInt == 4)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 5)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 6)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 7)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 8)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 9)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 10)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 11)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 12)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 13)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 14)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 15)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 16)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 17)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 18)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
if (GunInt == 19)
{
dbLoadObject ("MG42.x",GunInt);
WeaponActive = true;
dbScaleObject (GunInt,7000,7000,7000);
dbPositionObject (GunInt,20,80,35);
};
};
};
//these commands allow the player to take the selected gun
if (WeaponActive == true && GunInt != 2 && 220 >= camx && -220 <= camx && 101 >= camy && -101 <= camy && 110 >= camz && -110 <= camz)
{
dbText (5,465,"Hold F To Pick Up");
if (dbKeyState(33)==1)
{
dbLockObjectOn (GunInt);
dbPositionObject (GunInt,-10,-30,90);
dbRotateObject (GunInt,0,270,0);
boxantiloop = 0;
WeaponActive = false;
};
};
//this command moves the gun back down into the box
if (WeaponActive == true && dbObjectPositionY (GunInt) > 0)
{
dbMoveObjectDown (GunInt,0.2);
if (dbObjectPositionY (GunInt) <=0)
{
dbDeleteObject (GunInt);
WeaponActive = false;
boxantiloop = 0;
};
};
//this if tests to see if the player is in range of a door
if (door1antiloop == true && 400 <= camx && 800 >= camx && 101 >= camy && -101 <= camy && -2194 <= camz && -1896 >= camz)
{
dbText (5,465,"Hold F To Unlock Door (750)");
if (dbKeyState(33)==1 && Score >= 750)
{
Score -= 750;
dbDeleteObject (21);
door1antiloop = false;
};
};
if (door2antiloop == true && -780 <= camx && -380 >= camx && 101 >= camy && -101 <= camy && -2194 <= camz && -1896 >= camz)
{
dbText (5,465,"Hold F To Unlock Door (750)");
if (dbKeyState(33) && Score >= 750)
{
Score -= 750;
dbDeleteObject (22);
door2antiloop = false;
};
};
//these commands test for the player and switch 1 activation
if (switch1antiloop == true && -437 <= camx && -275 >= camx && 101 >= camy && -101 <= camy && -570 <= camz && -430 >= camz)
{
dbText (5,465,"Hold F To Activate");
if (dbKeyState (33) == 1)
{
switch1antiloop = false;
};
};
// if (switch2antiloop == true &&
// {
// dbText (5,465,"Hold F To Activate");
// if (dbKeyState (33) == 1)
// {
// switch2antiloop = false;
//};
// };
// if (switch1antiloop == false && switch2antiloop == false && lockdoorantiloop == true)
// {
// dbDeleteObject ( );
// lockdoorantiloop = false;
// };
//this small command displays the players score on the screen
char str[200];
sprintf ( str,"%i", Score );
dbText(dbScreenWidth() - dbTextWidth(str), 465, str);
// here we make a call to update the contents of the screen
dbSync ( );
}
return;
}
acctualy nevermind ill just fiddle with the code and if i cant figure this out ill post a new question just concerning this new problem.