What is the xRed position?

I’m a little confused on the xRed position?!?!

xRed and yRed position for the RED ball . Remember this should be set to x anywhere and y will be a random between 200 and 400. The ball will be width and height of 30
xBlue and yBlue position for the blue ball. Set this to 0, 0 and width and height of 30.
int xRed=int (random());
int yRed=int (random(200, 400));
int xBlue=0;
int yBlue=0;

What is your interpretation of what the xRed position is? And where anywhere is?

The Processing website is here:

https://processing.org/

It has references, tutorials and examples.

I suggest that you:

  • Read the Coordinate System and Shapes tutorial.
  • Find the reference to random() and a reference for the shape that you want to use for the RED ball.

:)

2 Likes

xRed is the x component of the red ball, and as per your brief is allowed any value, while yRed is the y component of the red ball and can only take values between 200 and 400.

Please read the reference about random to see how to define xRed