Sign in to follow this  
kingpinzs

DirectDraw sprite issue

Recommended Posts

How do i have my sprite shoot a bullet? This is what I have.
int  Game_Main()
{
    RECT r; 
 if (g_pddsprimary == NULL)
 {
     
		return(0);
}	
////////////////////////////////////////////
r.left = 0;
	r.top = 0;
	r.right = 800;
	r.bottom = 600;
	lpBackBuffer->BltFast(0, 0, g_pddground, &r, 
	DDBLTFAST_NOCOLORKEY | DDBLTFAST_WAIT); 
//the bug
	r.left = cl;
	r.top = ct;
	r.right = cr;
	r.bottom = cb;
	lpBackBuffer->BltFast(x, y, g_pddbug, &r, 
		DDBLTFAST_SRCCOLORKEY | DDBLTFAST_WAIT);
//Bullet
              r.left =0; 
              r.top =0;
              r.right =64;
              r.bottom=64;
              lpBackBuffer->BltFast(bx,by,g_pddbullet, &r,
                       DDBLTFAST_SRCCOLORKEY | DDBLTFAST_WAIT);
////////Spider movment
r.left = 0;
r.top = 0;
r.right = 64;
r.bottom = 64;
lpBackBuffer->BltFast(sx, sy, g_pddspider, &r, 
		DDBLTFAST_SRCCOLORKEY | DDBLTFAST_WAIT);

r.left = 65;
r.top = 0;
r.right = 128;
r.bottom = 64;
lpBackBuffer->BltFast(500,500,g_pddhouse,&r,
         DDBLTFAST_SRCCOLORKEY | DDBLTFAST_WAIT);


g_pddsprimary->Flip(NULL, DDFLIP_WAIT);
return(1);
}

How do get the sprite to display when I hit the sapce bar and how can i have alot of them and they just keep bouncing around the screen? I have been researching this problem but I can not find a tut that explains the loop and how to do this. can any one Help? Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this