/* built with Studio Sketchpad: * https://sketchpad.cc * * observe the evolution of this sketch: * https://studio.sketchpad.cc/sp/pad/view/ro.fhspLzDOSfL/rev.31 * * 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/noche.jpeg"; */ /* @pjs preload="/static/uploaded_resources/p.14209/dia.jpeg"; */ int posx; int posy; PImage dia; PImage noceh; float vel; float tamano; void setup() { size(500, 400); posx = 250; posy = 300; vel = 5; tamano = 5; dia = loadImage("/static/uploaded_resources/p.14209/dia.jpeg"); noche = loadImage("/static/uploaded_resources/p.14209/noche.jpeg"); } void draw() { image(dia,0,0,500,400); fill(255,255,0,70); ellipse(posx,posy,vel,vel); noStroke(); vel=vel+tamano; if(vel > 500) { tamano = -1; } if(vel < 0) { tamano= 5; } if(vel> width) { tamano = -5; noche = loadImage("noche.jpeg"); image(noche,0,0,500,400); } }