Sign in to follow this  
phil67rpg

breakout using directx

Recommended Posts

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);

Share this post


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

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