Jump to content
  • Advertisement
Sign in to follow this  

breakout ball and animation

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

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;
	rectx.top = 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;
	recty.top = 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!