breakout using directx
I am programming a breakout game. This is the code to move a paddle from left to right. I am trying to move a paddle from the left side of the screen to the right side of the screen.
j++;
//fill the surface with color
d3ddev->ColorFill(surface, NULL, D3DCOLOR_XRGB(0,0,0));
//copy the surface to the backbuffer
rect.left = j+180;
rect.right = j+260;
rect.top = 580;
rect.bottom = 600;
d3ddev->StretchRect(surface, NULL, backbuffer, &rect, D3DTEXF_NONE);
i++;
//fill the surface with color
d3ddev->ColorFill(surface, NULL, D3DCOLOR_XRGB(255,0,0));
//copy the surface to the backbuffer
rect.left = i+260;
rect.right = i+340;
rect.top = 580;
rect.bottom = 600;
d3ddev->StretchRect(surface, NULL, backbuffer, &rect, D3DTEXF_NONE);
What exactly is the problem you're running into? Also I should probably suggest that you look into using the ID3DXSprite interface for doing 2D work. It will probably be easier for you and should perform better.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement