For now, what i want to do is have the controllable square turn red when it touches another square. Eventually i will have the screen clear until the mouse is pressed. Please give any help on setting up the collision detection. Here is my code so far:
Rectangle rect1;
Rectangle rect2;
Rectangle rect3;
Rectangle rect4;
void setup() {
size(200,200);
rect1 = new Rectangle(color(255,0,0),0,random(200),random(2,5));
rect2 = new Rectangle(color(0,0,255),0,random(200),random(2,5));
rect3 = new Rectangle(color(0,255,0),0,random(200),random(2,5));
rect4 = new Rectangle(color(255,0,255),0,random(200),random(2,5));
Hey, I am completely new to Processing. For my first project I am attempting to create a game where rectangles move randomly across the screen and you have to avoid them with your mouse pointer.
My question is, how can i make the randomly moving rectangles?
I want them to go across the screen in one direction but start in different places and have random speeds