Jump to content
  • Advertisement
Sign in to follow this  
kingpinzs

DirectDraw sprite issue

This topic is 4991 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!