Unhandled exception at 0x77e315de in shooter 0.01.exe: 0xC0000005: Access violation reading location 0x00000008.
i get this in all projects i try to debug run. i am just gettting today, last week these progranms had no errors or unhandled exceptions. I cann't 'even rum simple programs that all they do is load 2 sprite. i just can't figure this out?
I did just install norton 360, so that may do this, but i don't know how to fix this, please help, ive spent the last 2.5 hours trying to figure this out. it happens after it loads my object..
my code is
// the wizard has created a very simple 2D project that uses Dark GDK
// it can be used as a starting point in making your own 2D games
// whenever using Dark GDK you m
#include "DarkGDK.h"
#include "dinput.h"
/*int GoForwardKey = dbUpKey();
int GoBackKey = dbDownKey();
int GoRightKey = dbrightKey();
int GorightKey = dbLefkey();
*/
//int InventoryKey i;
// int ActionKey = dbEKey();
// the main entry point for the application is t
void DarkGDK ( void )
{ //void begin
// in this application a backdrop is loaded and then several
// animated sprites are displayed on screen
int jaScreenWidth = 800;
int jaScreenHight = 600;
dbSetDisplayMode ( jaScreenWidth, jaScreenHight,0);
int JAhalfWidth = dbScreenWidth / 2;
int JAhalfHight = dbScreenHight / 2;
int JAdecaWidth = dbScreenWidth / 10;
int JAdecaHight = dbScreenHight / 10;
// when starting a Dark GDK program it is useful to set global
// application properties, we begin by turning the sync rate on,
// this means we control when the screen is updated, we also set
// the maximum rate to 60 which means the maximum frame rate will
// be set at 60 frames per second
dbSyncRate ( 60 );
// a call is made to this function so we can stop the GDK from
// responding to the escape key, we can then add in some code in our
// main loop so we can control what happens when the escape key is pressed
dbDisableEscapeKey ( );
// now we will set the random seed value to the timer, this will
// help us to get more random values each time we run the program
//dbRandomize ( dbTimer ( ) );
// we are going to display a backdrop for the scene, to do this
// we load our image and give it an ID number of 1, this particular
// image is of a sky at night with stars
//dbLoadImage ( "backdrop.bmp", 1 );
// the next step is to create a sprite that uses this image, this
// is achieved by calling dbSprite and passing in a value of 1 for the
// sprites ID, 0 for the X coordinate, 0 for the Y coordinates and a
// value of 1 for the image
// next we will load in some animated sprites, before doing this
// we need to adjust the image color key, by using this function we
// can make a specific color be transparent, in our case we want this
// to be bright pink
dbSetImageColorKey ( 255, 0, 255 );
// in this loop we're going to create some animated sprites, the image
// we load contains frames of animation for an asteroid
// for ( int i = 2; i < 30; i++ )
// {
// create an animated sprite and give it the ID number from the
// variable i, next is the filename, now we come to how many frames
// across and down, in our case this is 4, finally we come to the image
// ID that the sprite will use, again we use i
// dbCreateAnimatedSprite ( i, "sprite.bmp", 4, 4, i );
// position our sprite at a random location
//dbSprite ( i, dbRnd ( 640 ), -dbRnd ( 1500 ), i );
// }
//
// now we come to our main loop, we call LoopGDK so some internal
// work can be carried out by the GDK
//dbChangeMouse(2);
//dbMouse(); //dbSync();
dbLoadImage("leftboxingglove.png",2);
dbLoadImage("rightboxingglove.png",1);
dbSprite(1,0,40,2);
dbSprite(2,75,40,1);
dbSync();
while ( LoopGDK ( ) )
{ //while loop
if (dbKeyState(DIK_W))
{
//dbRotateSprite(1,90);
dbMoveSprite(1,1);
//dbRotateSprite(1,0);
}
if (dbKeyState(DIK_A))
{
dbRotateSprite(1,270);
dbMoveSprite(1,1);
dbRotateSprite(1,0);
}
if (dbKeyState(DIK_D))
{
dbRotateSprite(1,270);
dbMoveSprite(1,-1);
dbRotateSprite(1,0);
}
if (dbKeyState(DIK_S))
{
//dbRotateSprite(1,270);
dbMoveSprite(1,-1);
//dbRotateSprite(1,0);
}
if (dbRightKey() ==1)
{
dbRotateSprite(2,270);
dbMoveSprite(2,-1);
dbRotateSprite(2,0);
}
if (dbLeftKey() ==1)
{
dbRotateSprite(2,270);
dbMoveSprite(2,1);
dbRotateSprite(2,0);
}
if (dbUpKey() ==1)
{
//dbRotateSprite(2,270);
dbMoveSprite(2,1);
//dbRotateSprite(2,0);
}
if (dbDownKey() ==1)
{
//dbRotateSprite(1,270);
dbMoveSprite(2,-1);
//dbRotateSprite(1,0);
}
// run a loop through all our sprites
// here we check if the escape key has been pressed, when it has
// we will break out of the loop
if ( dbEscapeKey ( ) )
break;
// here we make a call to update the contents of the screen
dbSync ( );
// when the user presses escape the code will break out to this location
// and we can free up any previously allocated resources
// delete all the sprites
// delete the backdrop image
// and now everything is ready to return back to Windows
} //for
for ( int i = 1; i < 30; i++ )
{ //FOr
dbDeleteImage ( i );
dbDeleteSprite ( i );
} //for
return;
}//while
see? very simple that took me 45 minutes to write and an hour to draw the image files. It is taking 3 hours today and i am clules, pls help.
TIA
=Arkii=
Heres Johnny