Snow

Project information

  • Type: Released Student Game
  • Engine/Language: Custom Engine, C++
  • Date: Dec 2021 - Mar 2022
  • Team Size: Solo
  • Duration: 3 months
  • Project URL https://boyko03.itch.io/snow
Game

Snow

Dec 2021 - Mar 2022
BUas

2D ski game (Intake Project). One of the first games I ever made.

Project Overview

This game was both my BUas intake project and my high school graduation project. I made it using the template provided by BUas and free assets that I got from itch.

Game Modes

  • Slalom Mode: Players navigate a course, aiming to complete it as quickly as possible while passing on the correct side of flags.
  • Off-Road Mode: Players strive to survive for as long as possible to achieve higher scores.
Both modes feature procedurally generated levels, enhancing replayability. At the end of each mode, a leaderboard displays the top 10 scores for the selected difficulty.
Game mode selection

Procedural level generation

The map is grid-based. At first, I had a vector with all the tiles and I was adding and removing tiles from it as the player progressed which led to frequent memory allocations, impacting the performance.
To optimize, I implemented a system that tracks the "top row" and overrides it with new rows as the player progresses. This method reduced memory usage.

Since all tiles are using the same tilemap, I'm storing it as a static variable which saved me lots of memory too.

In Slalom Mode, flags are placed at intervals based on the difficulty level. In Off-Road Mode, increased difficulty results in more obstacles.

Each tile stores the terrain that it has and the object that is on it as an enum value. The object is chosen randomly with chances varying based on the selected difficulty. Based on the game mode there is also a chance for a random power-up (health or shield) to spawn.
If the chosen object is a tree, I have to check if the object above it is also a tree so that I can render it properly (different tiles for whether there are one or two trees).

The trees on both sides of the map are procedurally generated too.

Procedurally generated map for the off-road level

2.5D

The rendering system draws the background and foreground layers first, followed by the player character. Objects are redrawn based on the player's position within the tile, allowing the player to move in front of or behind objects, creating a 2.5D effect.

2.5D - rendering the player in front of / behind objects based on its position

Leaderboard

I have a text file for each mode-difficulty combination in which I store the top 10 scores. This allows me to easily retrieve the results and override them if needed. I chose to store them as plain text and not as a binary file, because I decided that readability is more important and it wouldn't have made a big difference.

Leaderboard - if the result is in top 10, it is highlighted in green

Collisions

I'm using AABB collision detection

Debug draw collisions

Project Features

  • Procedural level generation
  • 2.5D rendering
  • AABB collisions detection
  • Powerups
  • 2 game modes with 3 difficulties each

Technologies Used

Custom Framework C++ SDL2