top of page

Biscuit Clicker

Protect Your Product!

Technology: Visual Studios, Allegro Library
Date: Fall 2021

​

This game was created during a game architecture class in my fall semester, during my third year, at Champlain College. In this class, we spent most of the semester developing our own game engines in Visual Studios using the Allegro C++ library, with the final project having us team up and build a game using one of our engines. In this 2D clicker, you play as a baker trying to sell as many biscuits as you can. You do this buy clicking the Biscuit to earn money which can be spent on upgrades. Watch out for the pesky ants who try to hinder your progress. For the game, I spent most of my time working on UI, importing and exporting data: such as languages and save states, as well as building a state machine.

Biscuit Clicker (C++): Text

Engine

When it came to building the engine, I needed to be able to be able to crate a window as well as draw and manipulate sprites, animate them, and take input. Like many aspects of the engine, data was passed around using events, listening for specific changes both in the code and from the user. Event Listeners would be set up in the beginning of the program being run while the system are being initialized. Pictured below is the addition of listeners to the game class:

Game3.PNG
Biscuit Clicker (C++): Image

During engine development, since the sprites being used were the same size many sprite values were hard coded in consts during unit creation, this would be changed when transition to building a game. The unit creation process involves first setting up the sprite as a buffer which allows for sprites to be visible on screen before being converted to animation which is used to create the unit.

Game1.PNG
Biscuit Clicker (C++): Image

The animation portion of the unit pipeline saw a sprite sheet get parsed into the separate sprites which get used for animation. When sprites were drawn to the screen, and while animation is enabled, the animation class loops through each of the sprites in the order they were input into the system. A small portion of the animation loop is shown below:

Animation.PNG
Biscuit Clicker (C++): Image

Game

One of the systems I had to implement for this project was our localization. Besides English, the game needed to support 2 other languages. To handle this I built a text reader and a parser which took each line of text from the pile and split it up according to what language it belonged to. Pictured below is a portion of the language parser:

lang.png
Biscuit Clicker (C++): Image

When it came to managing how the game would transition between menus and game itself, the team decided that a state machine would be a good way to handle these transitions. The game contains 4 different states. Each state needs to be able to render Units, buttons, as well as listen for event and transition into and out of itself. Pictured below is the initialization function for the Option Menu State:

state.png
Biscuit Clicker (C++): Image

With all of the UI elements introduced in the project for the menu's and for the player, each one has it's own function. The way I went about separating the functionality was by giving each button a enum value which corresponded to what it did. When the button would be clicked, the enum value would determine which event would be fired, as seen below.

button.png
Biscuit Clicker (C++): Image
bottom of page