Homework 6: Functions & Game

Esther Barnett
2 min readFeb 26, 2021

This week I created a game based on a simple idea complied from Google and class.

Here is my game called Smiley Catcher:

In class, we discussed the idea of a bucket catching moving balls, so I began by Googling some ideas. The main ideas and references I utilized were:

I tried to utilize this creative idea while also adding individualistic spin on the code and idea of the game based on work I enjoy creating.

for the idea of an ellipse as a face and the main component of the game
the idea of the larger ball eating the smaller faces was lightly inspired by the Pacman game as well.

In my code, I established variables to utilize screen changes in order to start and stop the game. The idea of the game is to eat as many small smileys so you can grow the larger, eating smiley, and add on more points. The point tracker is on the main game screen, which is started by both the gameStart function and the draw function. The gameStart function calls both the smiley face that is falling in randomized positions on the screen and the large eating smiley that is moving along the x-axis utilizing the mouseX command and a specified reference to the height. The function written in the reference game gave me a good idea on how to count whether or not the ball is in an area where it can be count as a point or cause the game to re-start. When the ball is out of the grid area AKA not caught, the end screen is then brought up to re-start the game, as well as the size of the large smiley. I wanted to create a simple game with touches of the style I have been creating in class recently.