1st Year University Assignment

Written in C, uses SDL 2.0 to setup the window and draw to the screen.
Expects 2 players to play at the same time.

The first programming project of my first year, I decided to do more than the brief required (a simple game where a player would pick up gems) and turn it into a more feature complete game.

GitHub link

Technical Features

  • Player Snakes
    • Internally implemented using a doubly linked list.
    • The design is fairly modularised, in the future the game could theoretically have as many unique snakes as required that respond to different input.
    • The snake sprite sheet was custom made by me for this project, as I couldn’t find a suitable alternative.
    • Recoloured in the code, could potentially be spawned as any colour (not just orange/green).
  • Pickups
    • I used a simple 2D bounding box collision algorithm to detect when the player touches a pickup.
    • The amount of pickups is constant, but the types are randomised. There is a small chance that a moving knight will appear rather than a gem.
    • Knights
      • The brief for the assignment supplied me with a knight sprite sheet, expecting me to use the knight as a player character. When I decided to develop the game more I recycled the knight appearance and behaviour into a mobile pickup.
    • Gems
      • The colour is randomly decided at spawn time.

Improvements

  • Constrain the player to only move forward/left/right, disallowing their head from moving ‘backwards’ and immediately killing them.