Jump to content
  • Advertisement
Sign in to follow this  

Loading mulitple sprites (Directx C++)

This topic is 3038 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

At this moment I am trying to create either a space invaders or Asteroids clone using the above language and SDK. I have loaded up my player sprite, which moves along the X axis nicely, and also have one, stationary, enemy sprite. Could someone please help me with how I can load up the enemy sprite in either a grid like fashion ala space invaders or at random points like asteroids? Been at this for hours and can't for the life of me figure this out. I have also spent a vast amount of time on google and here trying to find out the solution as well. Below is how I'm loading up one image and drawing it.
//load image
D3DXVECTOR3 enemyPos = D3DXVECTOR3(300,300,0);
	cSprite theEnemy(enemyPos,d3dMgr->getTheD3DDevice(),"Images\\enemy.png");

//draw image
while( msg.message!=WM_QUIT )
		// Check the message queue
		if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE) )
			TranslateMessage( &msg );
			DispatchMessage( &msg );
			// Game code goes here
			rocketPos = D3DXVECTOR3(rocketTrans.x,rocketTrans.y,0);

			enemyPos = D3DXVECTOR3(enemyTrans.x,enemyTrans.y,0);

			theBackbuffer = d3dMgr->getTheBackBuffer();
			d3dMgr->updateTheSurface(aSurface, theBackbuffer);

Share this post

Link to post
Share on other sites
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!