// Charlotte's Web by E.B. White // Draws an interactive illustration of when Charlotte and Wilbur meet //Creator: Amanda Goldstein //Class: PUDT 1203 Creative Computing float spriteY; float spriteMoveY; void setup() { size(600, 400); spriteY = 200; spriteMoveY = 7; frameRate(10); } void draw() { background(255); fill(0, 0, 0); //move it spriteY = spriteY + spriteMoveY; if (spriteY >= 200) { spriteMoveY = -3; } if (spriteY <= 60) { spriteMoveY = 3; } spriteY = spriteY + spriteMoveY; PImage img1; //place clouds that move with mouse img1 = loadImage("clouds.png"); image(img1, mouseX, 6); noCursor(); //draw moving strand web rect(130, 20, 1, spriteY); //place pig PImage img2; img2 = loadImage("wilbur.png"); image(img2, 350, 150); //place text from story PImage img3; img3 = loadImage("text.png"); image(img3, 40, 220); //place spider PImage img4; img4 = loadImage("spider.png"); image(img4, 80, spriteY); //place spider web PImage img5; img5 = loadImage("web.png"); image(img5, -10, -80); }