Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i set a area?Please Help

Status
Not open for further replies.

Muk108

Programmer
Dec 28, 2001
5
US
I need to know how to set an area im my fram. It is so that a ball can not leave that area. does anyone know how to do that or who knows. if you could help that would be grate.

Thanks
 
Put the ball at the limit at the right bottom. Wright down the Top and Left numbers and when making the ball move make sure the ball's Top and/or Left is not higher than the numbers you wrote down. If your using a timer do a:

if(Ball->Left > left_wrote_down)
{
Ball->Left = left_wrote_down;
// Or
Ball->Left--;
// Or what you want todo
}

if(Ball->Top > Top_wrote_down)
{
Ball->Top = Top_wrote_down;
// Or
Ball->Top--;
// Or what you want todo
}
ThanQ, ;-)

JVFF (Janito Vaqueiro Ferreira Filho)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top