For my animated poster, I made this words jumping randomly everywhere in different colors. And for homwork, I added some interaction elements. If I click on my mouse and move it, I can erase the words. If I feel it’s too tired to clean all of it–press DELETE and all the words on the screen disappear!
I had struggle on this: I added a delay to my “draw” because I wanted to slow down the speed of the popping words, but then the reaction time for my mouse and keyboard also got longer.
float r; float g; float b; float x; float y; float size; void setup(){ size(1024,768); background(255); } void draw(){ delay(90); r=random(50,255); g=random(50,255); b=random(50,255); x=random(1024); y=random(768); size=random(20,50); fill(r,g,b); rectMode(CENTER); rect(x,y,size*5,size); fill(0); textSize(size); textAlign(CENTER,CENTER); text("IMA SHOW", x,y); textSize(random(10,20)); text("MAY13,18-20PM",y,x); if(mousePressed){ click(mouseX,mouseY); } if(keyPressed){ if(key==DELETE){ background(255); } } } void click(float x,float y){ fill(255); noStroke(); ellipse(x,y,300,300); }