while ( LoopGDK ( ) ) {
int mx = dbMouseX(); //debugging variables
int my = dbMouseY();
if(dbMouseX() > 0 && dbMouseX() < 640) //rotate camera based on mouse, fix to use distance and revert mouse to 0
dbYRotateCamera(1, dbCameraAngleY(1)+(2*(dbMouseX()-320)/100));
if((dbCameraAngleX(1)+(2*(dbMouseY()-240)/100)) > -90 && (dbCameraAngleX(1)+(2*(dbMouseY()-240)/100)) < 90) {
dbXRotateCamera(1, dbCameraAngleX(1)+(2*(dbMouseY()-240)/100));
}
if(!inMenu) {
int changeX;
int changeY;
if(dbMouseX() != 0 && dbMouseY() != 0) {
dbPositionMouse(320, 240);
changeX = dbMouseMoveX();
changeY = dbMouseMoveY();
dbTurnCameraRight(1, changeX/mouseSensitivity);
dbPitchCameraUp(1, -changeY/mouseSensitivity);
}
}
if(dbUpKey()) dbMoveCamera(1, 3);//moves the camera fowards and backwards, use in debugging, remove before beta testing
if(dbDownKey()) dbMoveCamera(1, -3);
PrismGamePlay.Turn(currentPlayer);//carry out all game related actions
if(dbScanCode() == HYPHEN) {//check for the dubuging key, the - key, if so, run the debuger, similar to the valve console
debuging = !debuging;
}
if(debuging) {
PrismDebug.RunDebug();
if(dbSpriteX(DEBUGSCREEN) != DEBUGSCREENX && dbSpriteY(DEBUGSCREEN) != DEBUGSCREENY) {
dbLoadImage("debugScreen.bmp", DEBUGSCREEN);
dbSprite(DEBUGSCREEN, DEBUGSCREENX, DEBUGSCREENY, DEBUGSCREEN);
}
}
else {
dbDeleteSprite(DEBUGSCREEN);
}
dbSync ( );// update the screen
}//THIS BRACKET. this bracket right here is the location of a "unhandled exception" error
//label end, if a quit command is issued, delete all objects before returning to windows
ExitLabel:
for(int i = 0; i < 100; i++) dbDeleteVector3(i);//detele all memory using objects
for(int i = 1; i < 100; i++) dbDeleteObject(i);
for(int i = 1; i < 50; i++) dbDeleteImage(i);
for(int i = 1; i < 10; i++) dbCloseFile(i);
for(int i = 0; i < 2; i++) dbDeleteCamera(i);
// return back to windows
return;
}//this is the end bracket of the main function.
-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.