I see Cake Monster as a game for all ages. There is one simple aim – to eat all the cake you can. There is no resolution, as Cake Monster never becomes full. As he eats the cakes, he responds by changing his eye colour to reflect his enjoyment.
With a cartoon aesthetic, the game appears playful, and possibly childlike at first glance. Though the game is simple, it’s something anyone can enjoy and find satisfaction in. To play Cake Monster requires some concentration – but a concentration that is kind of entrancing and addictive.
It is this kind of concentration that I love in a game. It takes me back to my days of playing Timon and Pumbaa’s Jungle Games – a set of five arcade style games. Thirteen years later, If I could find the disc, I’d probably still enjoy the games. I hope that Cake Monster is a small step in the direction of a timeless game that anyone can play.
After brainstorming a few different ideas and looking at various Learning Processing textbook exercises, I decided I would try to produce a basic arcade style game. It was in a sleep-deprived state where I came up with the Cake Monster concept. I wanted to create a cute and fun aesthetic, and I liked the idea of a monster that ate cake.
First, I mocked up some designs in Photoshop of how I wanted the objects to look. Initially I envisioned that there might be other objects also falling, such a bugs or a knife, however after further thought I changed my mind and decided to keep it simple.
The first thing I did in Processing was create the Monster class. I set it up to have a few variables that could be changed – such as its X and Y location and eye colour. I also made an allowance for a change to the diameter, in case the monster was to be recalled at a smaller size.
I created a setLocation method, which is used to map the X & Y location to the mouse coordinates in the main program. I then copied in the code I had separately produced in another sketch and placed it inside a function called Display(). This function displays the monster and is made up of various ellipses and one triangle.
Next, with the help of Learning Processing’s ‘Example 10-3: Bouncing Ball with Intersection’, I created a Boolean called intersect, which checks whether the monster is ‘intersecting’ the cake. It does this by using the dist() function to calculate the distance between the current X, Y and d’s X & Y, and returns true or false. This is called later in the main program.
Creating the Cake class was quite similar to the Monster class. I set it up with variables for its location, speed and size. I then created the constructor, which creates a new instance of Cake, at a random location and random speed (within the parameters specified).
Next I created the move() method, which animates the cakes down the screen by adding speed to their Y position. I followed this with another Boolean to check if the cake has reached the bottom of the screen. This is called in the main program. The display() method displays the cake, which is made up of various shapes. The final function is the “ate” function. This method simply changes the xPosition of the cake to somewhere off screen, so that it appears it has ‘disappeared’.
The timer class is also something I required assistance with, as we hadn’t looked at this in class. After some research into how I could program such a thing, I found Example 10-5: Object-oriented timer. It uses a method to start the timer and then stores this time in milliseconds. A Boolean then checks whether the total passed time is greater than the total time, and if it is, a new instance of Monster is created.
In the main program, these functions are called appropriately. Something I decided to add to the program to make it more interesting was the feature of the Monster’s eyes changing colour when it eats a cake. This was achieved fairly easily by calling the intersect Boolean in an if statement, and then calling monster.eCol to change to a random colour.
Once the program was created, I did a check to see how it ran. I noticed that it didn’t take long for the program to slow down, due to the build up of ‘eaten’ cakes, off screen. This problem was solved by research into an ArrayList which enables elements of the array to be deleted. I set the ArrayList to remove the first cake from the array once the array grows larger than 20, and this seems to have solved the problem.
Cake Monster was a very rewarding program to design. It could be expanded by including the aforementioned other objects, such as bugs etc, to which the monster could react negatively to. I would also like to implement a scoring system, and possibly levels. While making this program I learnt about new Processing methods, through research, which has added to my pre-existing knowledge from the semester. These two learning paths have allowed me to create a sketch that I am quite pleased with and enjoy using.







