Program a sketch that draws a "scene" that includes:
Display a title, centered near the top of the window, and display your name at the lower left. Make your creature (the "hero" but give him a better name than "Zoog") move around, following the mouse. Also draw a "monster" who chases the hero.
Be sure to begin with comment lines that state the purpose of your program (as well as your name), and begin each method (procedure, function, subprogram) with a comment line that states its purpose.
The draw() method should NOT actually draw anything;
instead, it calls other methods to do the work.
For example:
//// Project #1: Zoog follows mouse, monster chases him! //// Your Name, CST 112, 2015 Feb 2 // GLOBAL DECLARATIONS // float heroX, heroY; // ++++ ADDD DECLARATIONS HERE ++++ // void setup() { //// Setup: window size, etc. //// size( 640, 480 ); } void draw() { //// Next frame //// scene(); monster(); hero(); } void scene() { //// Scene: sky, sun, grass. background( 200, 200, 255 ); // Light blue sky. // ++++ ADDD YOUR CODE HERE ++++ // } |
Replacing "YN" with your initials, upload your project to your folder, as a file named: