/* built with Studio Sketchpad: * https://sketchpad.cc * * observe the evolution of this sketch: * https://studio.sketchpad.cc/sp/pad/view/ro.gPtlErDY7fX/rev.33 * * authors: * Natalia Valencia * license (unless otherwise specified): * creative commons attribution-share alike 3.0 license. * https://creativecommons.org/licenses/by-sa/3.0/ */ /* @pjs preload="/static/uploaded_resources/p.14209/andy.jpg"; */ /* @pjs preload="/static/uploaded_resources/p.14209/marilyn.jpg"; */ /* @pjs preload="/static/uploaded_resources/p.14209/mouth.jpeg"; */ /* @pjs preload="/static/uploaded_resources/p.14209/sign.jpeg"; */ Marilyn[] marilines; int nummarilines=40; void setup() { size (800,800); background (255); marilines=new Marilyn[nummarilines]; int posArreglo=0; while (posArreglo<nummarilines) { marilines[posArreglo]=new Marilyn ( random (width),random (height), random(800)); posArreglo=posArreglo+1; } } void draw() { background(255,99,75); int posArreglo=0; while (posArreglo<nummarilines) { marilines[posArreglo].dibujate(); marilines[posArreglo].muevete(); posArreglo=posArreglo+1; } } class Marilyn { PImage imageMarilyn; PImage andy; PImage sign; PImage mouth; float posx; float posy; float tamano; float rotacion; float rotacion2; float velx; Marilyn (float laposx, float laposy, float eltamano) { imageMarilyn=loadImage("/static/uploaded_resources/p.14209/marilyn.jpg"); andy=loadImage("/static/uploaded_resources/p.14209/andy.jpg"); sign= loadImage("/static/uploaded_resources/p.14209/sign.jpeg"); mouth=loadImage("/static/uploaded_resources/p.14209/mouth.jpeg"); posx=laposx; posy=laposy; tamano=eltamano; rotacion=0; rotacion=-6; velx=8; } void dibujate() { pushMatrix();//tablero temporal2 translate(posx,posy);//rotelo rotate(rotacion2); tint(255,200); image(andy,20,20, 300, 300); //pintelo popMatrix(); rotacion2=rotacion2-4; pushMatrix();//tablero temporal translate(posx,posy);//rotelo rotate(rotacion); imageMode(CENTER); smooth(); image(imageMarilyn,0,0); //pintelo popMatrix(); rotacion=rotacion+1; pushMatrix();//tablero tempora3 imageMode(CENTER); tint(255, 255, 0,90); image(sign,posx,posy); //pintelo popMatrix(); if(mousePressed) { tint (255,99, 75,90); image(mouth,random(width),random(height)); } if(keyPressed) { tint (255,99, 75,100); image(sign,random(width),random(height)); } } void muevete() { posx=posx+velx; } }