Hi,
I always wonder when beginners want to do complex stuff.
It's ambitious.
In real life do you also sit down in a cockpit of a 747 and say, wow I'm lost?
Or do you learn ride a bicycle first, a car, a small plane?
Ok, I want to encourage you to go the path step by step.
Do you know how to draw a single bouncing ball?
First
Do you know about setup(), draw() and mousePressed()?
http://www.processing.org/learning/gettingstarted/
http://www.processing.org/learning/overview/
Do you know the reference?
http://www.processing.org/reference/
2nd: Read
see
http://www.processing.org/learning/topics/bounce.html
and understand it, play with it,
Or
http://www.processing.org/learning/topics/circlecollision.html
Understand it, play with it...
A Remark
Since you have different phases / stages in your program, I recommend using states of program:
at the begining it's 0 - and mouse click let's something happen (white ball appears). Set state to 1 now.
When the mouse is pressed now, something else than before happens. That's the trick. (black ball appears). Set state to 2 now. Do this for all that you want to achieve. Your last state is quit or restart...
Otherwise you don't have full control over your program.
In the func mouseReleased() therefore have:
- void mouseReleased() {
- if (programState==0) {
- // expect white ball
- // kick in white ball
- programState=1; // move on
- println ("state " + programState);
- }
- else if (programState==1) {
- // black ball appears
- programState=2; // move on
- println ("state " + programState);
- }
- else if (programState==2) {
- // whatever
- programState=3; // move on
- println ("state " + programState);
- }
- // etc. etc.
- else {
- // Error
- // unknown programm state
- println("unknown programm state +++++++++++++ it was " +programState);
- exit(); // quit program
- } // end of if
- } // end of func
Greetings, Chrisir