Code: Select all
//Move the computer controlled paddle
//Move the paddle up
if (BallPos.y < PaddlePos.y)
{
PCrectangle.move(0, -1);
}
//Move the paddle down
if (BallPos.y > PaddlePos.y)
{
PCrectangle.move(0, 1);
}
Code: Select all
//Move the computer controlled paddle
//Move the paddle up
if (BallPos.y < PaddlePos.y)
{
PCrectangle.move(0, -1);
}
//Move the paddle down
if (BallPos.y > PaddlePos.y)
{
PCrectangle.move(0, 1);
}