Blinkin on eyes applet
in
Programming Questions
•
7 months ago
Hi, Im noob and my code is:
- void setup()
- {
- size(400,200);
- background(0);
- stroke(12,12,12);
- smooth();
- frameRate(30);
- stroke(0);
- ellipseMode(CORNERS);
- ellipse(15,60,185,140);
- stroke(0);
- ellipseMode(CORNERS);
- ellipse(215,60,385,140);
- }
- void draw()
- {
- background(0);
- smooth();
- frameRate(30);
- //:Вежда лява
- fill(255);
- rectMode(CENTER);
- rect(100,35,170,15);
- //:Вежда дясна
- fill(255);
- rectMode(CENTER);
- rect(300,35,170,15);
- //:Орбита (голяма) лява
- fill(255);
- ellipseMode(CORNERS);
- ellipse(15,60,185,140);
- //:Орбита (малка) лява
- fill(255);
- ellipseMode(CORNERS);
- ellipse(215,60,385,140);
- //:Цвят и движение на заницата (Ляво)
- int x = constrain (mouseX, 70, 130);
- fill(mouseX,0,mouseY);
- strokeWeight(6);
- ellipseMode(CENTER);
- ellipse(x,100,70,70);
- //:Цвят и движение на заницата (дясно)
- int y = constrain (mouseX, 270, 330);
- fill(mouseX,0,mouseY);
- strokeWeight(6);
- ellipseMode(CENTER);
- ellipse(y,100,70,70);
- //:Pupille ляво
- int m = constrain (mouseX, 53, 148);
- int n = constrain (mouseY, 80, 120);
- fill(0);
- stroke(0);
- ellipseMode(CENTER);
- ellipse(m,n,20,20);
- //:Pupille дясно
- int a = constrain (mouseX, 250, 350);
- int b = constrain (mouseY, 80, 120);
- fill(0);
- stroke(0);
- ellipseMode(CENTER);
- ellipse(a,b,20,20);
- }
- void mousePressed() //raises the eybrow
- {
- frameRate(10);
- fill(0);
- rectMode(CENTER);
- rect(100,35,170,15);
- fill(255);
- rectMode(CENTER);
- rect(100,10,170,15);
- //:gives the coordinates in the comment box
- println (""+mouseX+"+"+mouseY+"");
- }
- void blinkInterval() //Мигане
- {
- if (millis() < 8000)
- {
- frameRate(7);
- fill(0);
- stroke(0);
- rectMode(CENTER);
- rect(15,70,350,55);
- fill(0);
- stroke(0);
- rectMode(CENTER);
- rect(15,130,350,45);
- fill(0);
- stroke(0);
- rectMode(CENTER);
- rect(385,70,350,55);
- fill(0);
- stroke(0);
- rectMode(CENTER);
- rect(385,130,350,45);
- }
I want to make the eyes blinkin in interval of 3 seconds...
1