CIS 3.5 - Spring 2010 Application Template M. Meyer Note: Fill in the appropriate sections to make your program. */ // Quick comment. /* Longer comment */ /** Very long comment. / /** ******************** Variables: Variables provide a way to save information within your sketch and use it to control the size, position, shape, etc. of what you are drawing. */ int x = 0; int y = 50; int xsize = 1; int ysize = 1; int xmodifier = 1; int ymodifier = 1; /** ******************** setup(): Use setup() to specify things that need to be done once, when the sketch first opens. */ void setup() { size(300,300); background( #000000 ); } /** ******************** Use draw() to specify things that you want to have done repeatedly. NOTE: draw() must be present in your program, even if it is left empty. */ void draw() { background( #000000 ); ellipse( width/2, height/2, xsize, ysize ); xsize = xsize + xmodifier; ysize = ysize + ymodifier; if ( xsize > width || xsize < 1 ) { xmodifier *= -1; } if ( ysize > height || ysize < 1 ) { ymodifier *= -1; } } /** ******************** Event Listners: Use event-listners like keyPressed() to allow users of your program to cause things to happen. */ /** ******************** Functions: Functions are sections of code that you create and name. */ /** ******************** Classes: Used to create objects.

Source code: Lab2_Example

Built with Processing