Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

space invaders sprites

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 phil67rpg   Members   

404
Like
0Likes
Like

Posted 04 June 2012 - 10:45 PM

I am working on a space invaders game using dx9 and c++.I am trying to render a row of alien sprites.I need six sprites for each row.
here is the code I am using.
void render_alienone()
{  
  D3DXMATRIX Matrix_alien;
  D3DXVECTOR2 Translation_alien(k++,50);
  if(k==820)
  {
  k=0;
  }
  D3DXMatrixTransformation2D(&Matrix_alien, NULL, NULL, NULL, NULL, 0, &Translation_alien);
  
  g_Sprite->Begin(0);
  g_Sprite->SetTransform(&Matrix_alien);
  RECT rect;
  rect.left=0;
  rect.right=40;
  rect.top=0;
  rect.bottom=rect.top+30;
  g_Sprite->Draw(g_Texture_alien, &rect, NULL, NULL, 0xFFFFFFFF);
  g_Sprite->End();
 
  D3DXMATRIX Matrix_alien2;
  D3DXVECTOR2 Translation_alien2(l++,50);
  if(l==820)
  {
  l=0;
  }
  D3DXMatrixTransformation2D(&Matrix_alien2, NULL, NULL, NULL, NULL, 0, &Translation_alien2);
  g_Sprite->Begin(0);
  g_Sprite->SetTransform(&Matrix_alien2);
  RECT rect2;
  rect2.left=0;
  rect2.right=30;
  rect2.top=0;
  rect2.bottom=rect2.top+30;
  g_Sprite->Draw(g_Texture_alien2, &rect2, NULL, NULL, 0xFFFFFFFF);
  g_Sprite->End();
};

I will continue to work on the problem and any help will be greatly appreciated.

#2 Ashaman73   Members   

13714
Like
0Likes
Like

Posted 04 June 2012 - 11:34 PM

I will continue to work on the problem and any help will be greatly appreciated.

Ehhm...what is your problem ?

Ashaman

 

Gnoblins: Website - Facebook - Twitter - Youtube - Steam Greenlit - IndieDB - Gamedev Log


#3 phil67rpg   Members   

404
Like
0Likes
Like

Posted 06 June 2012 - 06:27 PM

I am trying to use either vectors or arrays to store the alien sprites,I dont want to render each sprite one at a time but to draw sprites one row of six at a time.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.