HW 1: Bouncing “Hello, World!”

PAT 204/504: Creative Coding (Fall 2025)

Due at 11:59pm ET on September 8


Instructions


Q1: Hello, World! (2 points)

“Hello, World!” is usually the first program we write when learning a new programming language. Although that’s not quite the case for Processing, we can do something cooler in Processing.

Let’s start from writing a Processing sketch that

Q1

Please submit your code as a PDE file and the final rendering as a PNG file.


Q2: Bouncing “Hello, World!” (3 points)

Now, let’s make it a bouncing “Hello World!”. That is, the text box should

Q2

Please submit your code as a PDE file and the final rendering as an animated GIF file.


Template Sketch

Here is a template sketch for you to get started with:

String msg = "Hello, World!\nThis is {YOUR NAME HERE}!";
float fontSize = 24; // font size
boolean saveFrames = false; // whether to save the frames
float speedX = 1; // speed along the x-axis
float speedY = 2; // speed along the y-axis

// DEFINE OTHER GLOBAL VARIABLES YOU NEED HERE

void setup() {
  // Set the frame rate to 30 fps
  frameRate(30)

  // YOUR CODE GOES HERE
}

void draw() {
  // YOUR CODE GOES HERE

  // Save frames for making a GIF
  if (saveFrames) {
    saveFrame("frames/###.png");
  }
}

Note that the template includes a boolean switch saveFrames that controls if the saveFrame() function at the end of the draw() function will be executed. When saveFrames is set to true, each frame generated by a call of the draw() function will be saved to the folder frames/ in the project directory. You can then use the built-in movie maker (“Tools > Movie Maker”) to create an animated GIF. Also, the GIF standard does not support 60 fps, so we need to add frameRate(30) to the setup() function to set the frame rate to 30 fps.


Hints


Hosted on GitHub Pages. Powered by Jekyll. Theme adapted from minimal by orderedlist.