i want to make a pong game and i want the second wall to be moved by the computer if the ball is under 400 X but i have trouble getting the X of the ball :(
my code is like this
public void automove()
{
if(getX(Ball) <= 400)
{
if(getY(Ball) < getX() - 20)
{
move(4);
}
if(Ball.getY(Ball) < getX() + 20)
{
move(4);
}
}
}