I spent my term one school break designing a very fun game with my father.
This was my second computer science assignment for school and I couldn’t believe how quickly we finished ideating, designing, and coding the netire game. It took us less than a week! And we named it Caver Drone.
Planning
The genre of Caver Drone is an endless runner or infinite runner type stimulation with the theme of adventure in the gameplay.
Game’s mechanics and structure:
The game starts with the splash screen where the name Caver Drone and the instructions to play are displayed. As soon as the player presses any key on the keyboard, the game begins.
The drone in the game can be controlled using the up and down arrow keys. This lets the drone pass through the obstacles, which are the stalagmites and stalactites. If the player does not press the appropriate keys, the drone is set to automatically fall due to gravity. The drone itself is not moving towards the obstacles, but the frames of the stalagmite and stalactite that are.
Passing each pair of stalagmite and stalactite gets the player +10 points and it is displayed at the top left corner of the screen. When a player is playing the game for the first time the best score is set to 0. But after the player plays the first time, it remembers the score and displays it as the best score for the next round. This best score is stored as a text file named score and can be found in the assets folder. It can be edited or even deleted. However, deleting the text file results in the best score being reset to zero. This is because the code logic looks for a score.txt to edit in the assets folder and if it is not found (if it’s the first time the player is playing the game or if it’s deleted), the code creates a new score.txt and adds the best score to it.
The player can press escape to quit the game after the ‘game over’ text is displayed.
Objective and gameplay:
The objective is for the drone to explore the cave without hitting the pairs of stalagmite and stalactite. As soon as the drone collides with one of them, the drone crashes and a “Game Over!” is displayed to the player. The up and down arrow keys help the player navigate between the different sized formations without crashing into them. Only the up and down arrow keys are functionable, the other keys are disabled. This makes the game easy to play minimal training required.
Game Idea:
The idea for the game was inspired by the documentary ‘The Rescue (2021)’ which follows the Tham Luang cave rescue mission that rescued a junior football club. This was the basic idea for the theme of the game.
The stalactites are mineral formations that hang from the ceilings of caves and stalagmites are mineral formations that rise from the cave floor. They are always found in pairs as stalagmites are the accumulation of materials that drip from stalactites. These formations are the obstacles in the game, which the drone must avoid to prevent a collision.
illustrations of game logic


This illustration shows the equations used to determine the dimensions of the pairs of polygons (stalactite and stalagmite).
The basic formula in the code to draw a triangle using three points is: pygame.draw.polygon(screen, colour, [(x1, y1), (x2, y2), (x3, y3)])
The bottom polygon (stalagmite) is the first one to be calculated and drawn followed by the top polygon. We start by having the fixed positions:
- Dimension of window: 800 x 1500
- Gap between both polygons: 300
- Width of polygon (W1): 100
- Height of bottom polygon (h1): Randomly generated from a range of 50-450, with increments of 50
- Height of top polygon (h2): 800-h1-gap
The three points for the bottom polygon (stalagmite) are:
- x1 = x2+50 and y1 = 800-h1
- x2 = x2 and y2 = 800
- x3 = x2+100 and y3 = 800
The three points for the top polygon (stalactite) are:
- x1 = x2 and y1 = 0
- x2 = x2+50 and y2 = 800-h1-gap
- x3 = x2+100 and y3 = 0
This is how the stalactite and stalagmites are created with different heights.
Splash Screen Designing


Flowchart of game logic

