Sign in to follow this  

breakout ball and animation

Recommended Posts

I want to animate a breakout ball using directx.Here is the code I am working on.
	//initialize ball
	int ball_left=390;
	int	ball_right=410;
	int	ball_top=290;
	int	ball_bottom=310;

	//draw ball
	d3ddev->ColorFill(surface, NULL, D3DCOLOR_XRGB(255,255,255));
	RECT rectx;
	rectx.left = ball_left;
	rectx.right = ball_left+20; = ball_top;
	rectx.bottom = ball_top+20;
	d3ddev->StretchRect(surface, NULL, backbuffer, &rectx, D3DTEXF_NONE);

	//draw black ball
	d3ddev->ColorFill(surface, NULL, D3DCOLOR_XRGB(0,0,0));
	RECT recty;
	recty.left = ball_left+10;
	recty.right = ball_left+30; = ball_top+10;
	recty.bottom = ball_top+30;
	d3ddev->StretchRect(surface, NULL, backbuffer, &recty, D3DTEXF_NONE);

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