mousePressed not working as I have intended...
in
Programming Questions
•
8 months ago
Hello, here is my code.
- String words[] = {"desperation","anticipation","disappointment","depression","acceptance","masturbation","fapping","alone","time","jerking","loving","sensations","bond","together","life-partners","masturbation","imaginary","unobtainable","non-existent","gay","girlfriend","masturbation","porn","junkie","romance","skin","love","passionate","steamy","steamy","non-existent","unknown","whatever","overrated","stupid","terror","explosive","blind","individual","wanted","random","sexy","interesting","laughable","colorful","water","run","master","better","best","slutty","unexpected","unprotected","lustful","mistakes","avoidant","non-existent","timid","awkward","confused","fun","playful","evolving","exciting","temporary","imaginary","non-existent","internet","porn","fantasy","awkward","consent","meaningful","passionate","funny","honesty","secured","virgin","confidence","hopeless","solitary","non-existent","passed","abandoned","insecure","love","fun","friends","caring","sad","exciting","blossoming","safe","comforting","fun","solitary","non-existent","passed","abandoned","insecure","coffee","exam","sex","loneliness","thermos","dialog","awkward","wonderful","exciting","mutual","sexual","boring","whatever","painful","menial","contained","delicate","reluctant","stolen","passionate","fun","neat","naughty","fun","fun","one","join","together","help","comfort","muted","uninteresting","forced","longing","jealous","cuddles","fun","fucked","feet","manhood","shy","pulsating","vibrations","frictionate","love-drips","herpes","non-existent","13-inches","blood","butt","connection","love","magic","partnership","trust","empty","envy","selfish","hate","lackluster","uninhibited","understanding","warm","selfish","escape","thrilling","fun","tense","secretive","intimacy","warm","loving","compassionate","enjoyable","bonding"
- };
- float rate[] = {2.08, 7, 2.5, 1.67, 7.92, 3.92, 2.5, 5.92, 3.83, 3.83, 8.42, 6.58, 7.08, 7.5, 8.08, 4.58, 3.42, 3.25, 2.58, 5.25, 5.92, 4.58, 3.5, 2.08, 7.83, 7.17, 8.46, 8.25, 8, 8, 2.58, 4.42, 3.33, 4.17, 3, 2.42, 6.83, 3.33, 5.92, 7.33, 3.75, 7.92, 7.33, 6.25, 6.75, 6.33, 4.08, 4.42, 6.42, 7.75, 2.5, 5.5, 2.42, 6.58, 3.58, 3.17, 2.58, 3.42, 3.92, 3.83, 8.08, 7.08, 7.17, 7.83, 3.58, 3.42, 2.58, 3.17, 3.5, 5.83, 3.92, 7, 8.08, 8.25, 6.58, 9.25, 7, 4.58, 7.58, 2.58, 3, 2.58, 3.25, 2, 2.83, 7.92, 8.08, 4.92, 8.08, 2.42, 7.83, 7.25, 8, 7.33, 8.08, 3, 2.58, 3.67, 2, 2.83, 4.08, 2.92, 7.77, 2.17, 4.17, 6.85, 3.92, 8.15, 7.83, 8, 7.62, 2.75, 3.38, 2.54, 3.33, 4.31, 5.62, 3.08, 2.25, 8.25, 8.08, 6.42, 6.58, 8.08, 8.08, 3.92, 6, 7.5, 4.31, 7.46, 3.46, 2.77, 1.38, 3.92, 2.83, 7, 8.08, 4.25, 4.15, 4.23, 4.58, 6.23, 5.54, 6.25, 3.54, 1.5, 2.58, 3.83, 2.54, 5.67, 8.08, 8.46, 7.5, 7.62, 9, 2.08, 2.58, 2.08, 1.77, 2.62, 4.31, 7.69, 6.92, 2.77, 4.5, 7.58, 8.08, 3.92, 3.77, 7.83, 6.29, 8.42, 8.33, 7.42, 7.33};
- float theta = 0;
- float x = 0;
- float y = 0;
- float clump1x=0;
- float clump1y=0;
- float clump2x=0;
- float clump2y=0;
- float clump3x=0;
- float clump3y=0;
- boolean mouse = false;
- void setup() {
- size(800, 600);
- smooth();
- rectMode(CENTER);
- noStroke();
- fill(0);
- }
- void draw(){
- drawClump1();
- }
- void drawClump1(){
- for (int i=0; i< words.length;i++){
- }
- background(255);
- pushMatrix();
- if (mousePressed == true) {
- mouse = true;
- }
- if (mousePressed == false) {
- translate(clump1x, clump1y);
- mouse = false;
- if (mouse)
- {
- translate(mouseX, mouseY);
- }
- }
- translate(clump1x, clump1y);
- rotate(theta);
- theta += TWO_PI/500;
- pushMatrix();
- //yes, I painstakingly relearned Trigonometry to do this.
- translate(x, y+200);
- //x axis and radius
- ellipse(0, 0, 50, 50);
- popMatrix();
- pushMatrix();
- translate(sin(radians(72))*-200, (cos(radians(72))*200));
- //cos(18)
- ellipse(0, 0, 50, 50);
- popMatrix();
- pushMatrix();
- translate(cos(radians(54))*-200, (sin(radians(54))*-200));
- //cos(54)
- ellipse(0, 0, 50, 50);
- popMatrix();
- pushMatrix();
- translate(sin(radians(36))*200, (cos(radians(36))*-200));
- //cos(18)
- ellipse(0, 0, 50, 50);
- popMatrix();
- pushMatrix();
- translate(cos(radians(18))*200, (sin(radians(18))*200));
- //cos(18)
- ellipse(0, 0, 50, 50);
- popMatrix();
- ellipse(0, 0, 100, 100);
- popMatrix();
- }
This is what I am trying to do:
1. First, the screen is clicked, and the object transfers to the location of the cursor and follows the cursor.
2. The mouse button is released.
3. The mouse button is clicked again, and the object returns to its section of the screen.
1. First, the screen is clicked, and the object transfers to the location of the cursor and follows the cursor.
2. The mouse button is released.
3. The mouse button is clicked again, and the object returns to its section of the screen.
1