Basically I have to write a program where its divided into quaters and once the
program starts, a ball is displayed in the centre of one quadrant. The ball has a fixed
radius but a randomly set color. Then I can click the ball and drag it to a different quadrant. The ball is displayed when being dragged. The destination quadrant is the one where the mouse is released. The ball is displayed in the centre of the destination quadrant with a new randomly set color.
I understand what needs to be done on paper I just have no idea how to go about it. My methods for defining class Ball didnt work and ive been stuck ever since.
Hello, am having 2 problems with this code I am trying to write. I need to make the black ball continue to rise on its own after keyPressed. At the moment I need to hold down a key for it to continue to rise which is wrong however I dont know how to fix it.
The second problem is I have no idea how to make the code register the 2 balls colliding, and then stopping the program and making the screen go blank. If the 2 balls dont collide then the black ball can go off the screen and then the program also stops.
I am quite new to processing and need to figure out a way to write a small program which waits for a mouse button press and then draws a rectangle from the starting point at which the mouse button was pressed to the current location of the mouse. And when the button is released the rectangle needs to disappear.
I am completely lost with how to go about this.
There are some other elements required for the program but I want to figure out how to do those on my own.