bethdps

Braun

Oct 11th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.54 KB | None | 0 0
  1. int m=10;
  2. boolean expandindo = true;
  3.  
  4. void setup() {
  5.   size(600, 600);
  6.   frameRate(20);
  7. }
  8.  
  9. void draw(){
  10.  
  11.   background(255);
  12.   drawBraunA(m);
  13.  
  14.   if(m < 50 && expandindo){
  15.     m++;
  16.   }else{
  17.     expandindo = false;
  18.     m--;
  19.    
  20.     if(m < 10){
  21.       expandindo = true;
  22.     }
  23.   }
  24.  
  25. }
  26.  
  27. void drawBraunA(int moduloPadrao) {
  28.   int moduloMeio = round(1.3 * moduloPadrao);
  29.  
  30.   noStroke();
  31.  
  32.   fill(0);
  33.   rect(width/2 - moduloMeio/2, height/2 - moduloPadrao/2, moduloMeio, moduloPadrao);
  34.  
  35.   //parte direita do A
  36.   rect(width/2 - moduloPadrao - moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao, moduloPadrao*7);
  37.  
  38.  //parte esquerda do A
  39.   rect(width/2 + moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao, moduloPadrao*7);
  40.  
  41.   rect(width/2 - moduloMeio/2, height/2 - moduloPadrao*5, moduloMeio, moduloPadrao);
  42.  
  43.  //arcos da parte de cima do A
  44.   arc(width/2 - moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao*2, moduloPadrao*2, PI, PI*3/2);
  45.  
  46.   arc(width/2 + moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao*2, moduloPadrao*2, PI*3/2, 2*PI);
  47.  
  48.   rect(width/2 - moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao/4, moduloPadrao/4);
  49.   rect(width/2 + moduloMeio/2 - moduloPadrao/4, height/2 - moduloPadrao*4, moduloPadrao/4, moduloPadrao/4);
  50.  
  51.   fill(255);
  52.   ellipse(width/2 - moduloMeio/2 + moduloPadrao/4, height/2 - moduloPadrao*4 + moduloPadrao/4, moduloPadrao/2, moduloPadrao/2);
  53.   ellipse(width/2 + moduloMeio/2 - moduloPadrao/4, height/2 - moduloPadrao*4 + moduloPadrao/4, moduloPadrao/2, moduloPadrao/2);
  54. }
Add Comment
Please, Sign In to add comment