Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int m=10;
- boolean expandindo = true;
- void setup() {
- size(600, 600);
- frameRate(20);
- }
- void draw(){
- background(255);
- drawBraunA(m);
- if(m < 50 && expandindo){
- m++;
- }else{
- expandindo = false;
- m--;
- if(m < 10){
- expandindo = true;
- }
- }
- }
- void drawBraunA(int moduloPadrao) {
- int moduloMeio = round(1.3 * moduloPadrao);
- noStroke();
- fill(0);
- rect(width/2 - moduloMeio/2, height/2 - moduloPadrao/2, moduloMeio, moduloPadrao);
- //parte direita do A
- rect(width/2 - moduloPadrao - moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao, moduloPadrao*7);
- //parte esquerda do A
- rect(width/2 + moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao, moduloPadrao*7);
- rect(width/2 - moduloMeio/2, height/2 - moduloPadrao*5, moduloMeio, moduloPadrao);
- //arcos da parte de cima do A
- arc(width/2 - moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao*2, moduloPadrao*2, PI, PI*3/2);
- arc(width/2 + moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao*2, moduloPadrao*2, PI*3/2, 2*PI);
- rect(width/2 - moduloMeio/2, height/2 - moduloPadrao*4, moduloPadrao/4, moduloPadrao/4);
- rect(width/2 + moduloMeio/2 - moduloPadrao/4, height/2 - moduloPadrao*4, moduloPadrao/4, moduloPadrao/4);
- fill(255);
- ellipse(width/2 - moduloMeio/2 + moduloPadrao/4, height/2 - moduloPadrao*4 + moduloPadrao/4, moduloPadrao/2, moduloPadrao/2);
- ellipse(width/2 + moduloMeio/2 - moduloPadrao/4, height/2 - moduloPadrao*4 + moduloPadrao/4, moduloPadrao/2, moduloPadrao/2);
- }
Add Comment
Please, Sign In to add comment