Modify a text file: $/images1024b.pde
$/images1024b.pde
// Images // bam:"0a24c PImage count, jab, duck; String url= "http://suffolk.li/cst112/01cst112/day/U/files/"; String img= "http://www.suffolk.li/img"; String web= "http://www.suffolk.li/img/websitedevelopment-img/"; float duckX=-999, duckY=-999; Moose moose; void setup() { size(1100, 750); background(255); jab= loadImage( url + "jaberwocky.jpg" ); count= loadImage( url + "count.png" ); duck= loadImage( url + "The_Big_Duck.JPG" ); moose = new Moose(); } void draw() { background(255); image( jab, 0,0 ); image( duck, duckY, duckY ); if (mouseY>200 ) { int countW, countH; countW= 50 + mouseX/10; countH= 50 + mouseY/10; image( count, mouseX, mouseY, countW, countH ); } action(); } void action() { moose.show(); moose.move(); if (moose.near(mouseX,mouseY)) moose.reset(); } void keyPressed() { if(key == 'r') { background(0); } } void mousePressed() { duckX= mouseX; duckY= mouseY; } //// OBJECTS //// class Moose { float x=-999, y=-999, xx=5, yy=3; PImage pix; //// CONSTRUCTOR(S) //// Moose() { pix= loadImage( web + "anielg.gif" ); reset(); } void reset() { x= random(width/2,width); y= random(height/2,height); } //// METHODS //// void show() { image( pix, x, y ); } void move() { // Moose runs around, bounces off walls, etc. x += xx; y += yy; if (x>width-50) xx = -xx; if (x<50) xx = -xx; if (y>height-50) yy = -yy; if (y