/* April Grow (agrow) * November 18, 2009 * Processing Monster for Film 20c at UCSC * Monster inspired by mb09's BlinkEyeMonster: * http://www.rmx.cz/monsters/blink_eye_monster/index.html * * Main file: Initializes cat/world objects, tests for mouse activity, and draws/updates all objects in the program */ Boolean mouse = false; Cat kitty; World world; void setup(){ size(600, 400); // specifies width and height of the window frameRate(30); // specfies 30 frames to be updated every second smooth(); // smooths the edges of geometry background(255); // sets background color to white kitty = new Cat(width/2, height*9/10); world = new World(); } /* Processing Function * Activates if any mouse button is pressed, and turns flag mouse press to true */ void mousePressed() { mouse = true; } /* Processing Function * Activates if any mouse button is released, and turns flag mouse press to false */ void mouseReleased() { mouse = false; } /* Processing Function * Draws objects/background to the screen, refreshing every 30 seconds (frameRate) */ void draw(){ background(255); // clears background to white every frame noStroke(); // does not draw outlines of objects kitty.update(mouseX, mouseY); // Moves the kitty left/right kitty.jump(mouseX, mouseY, mouse); // Moves the kitty up on click/down on drop kitty.draw(); // Draws the kitty world.draw(); // Draws the world }