Catch the Candy! Halloween Edition

Sia Chang
3 min readOct 7, 2020

--

Soooooo… in the spirit of Halloween, I made the famous catching game with a little bit touch of spookiness!

The game is inspired by “Touch the cube” by “batmangreen123” from the following website:

About the game!

The logistics of the game is pretty straight forward. The player controls the catcher, which is a ghost in my edition, by moving the mouse to catch candies randomly dropping from the top of the screen. If the candy is caught, the player scores 1, and another candy will drop at a faster speed; otherwise, the player loses the game, and the ending screen shows the overall score the player earned.

Creating the game!

In order to make the game stand out from other basic catching games, I uploaded the Halloween images to the p5js file and preload to the sketch.

Then, create the canvas and draw the 3 types of screens. Add text to the screens for game instructions.

By creating variables for the ghpst, candies and the score, I then designed the logics of candy dropping, score adding, and losing the game.

To play the game or to view the original codes, use the link below:

Obstacles I encountered…

I forgot to reset the values of scores and positions of game elements at first, so when a new game is created, the score value and the speed of candies were still from the last round. So I added the reset() function at the end so that whenever a new game is created, everything starts from scratches.

So that’s about my week 4 assignment, happy Halloween!

References:

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Responses (1)

Write a response