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.
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, ;-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.