skip to content
heny.quest
Rixa cover image

Rixa - Top-Down Shooter

/ 4 min read

Check out Rixa’s

About

Rixa is a retro, top-down shooter inspired by Commando on the C64. This was originally a group project done under the Developer Academy last year. I decided to overhaul it as I recently got some amazing C++ feedback and thought it was a great chance to put it into practise.

This was made using C++ and Sumo Digital’s Playbuffer library.

Rixa GIF

Refactoring

The original codebase was admittedly very messy — a reason why this project was not previously included in my portfolio. This was due to a number of reasons, but the main one was time constraints.

It was also our introduction to C++ games development, so some fundamental C++ practices were missing. E.G., Heap memory de-allocation, const correctness and others.

If you want to see a side-by-side, check out the last two overhaul commits:

  1. Initial Overhaul
  2. Final(?) Changes

Here are some of the improvements I made to the codebase:

Implementation

  1. Projectiles

    • Projectiles initially didn’t have their own class and were handled by the game object that spawned them.

    • Now broken down into PlayerProjectile and EnemyProjectile which inherit from the Projectile class.

    • The ProjectileManager is a static class which handles updating all the projectiles.

    • Projectiles have references to the owner that spawns them, which allows me to apply enemy specific attack ranges and damage. This is instead of having the Enemy and Player manage them directly in order to apply the same.

      See RIXA/Source/Manager/ProjectileManager.cpp

      See in RIXA/Source/Actor/:

      1. Projectile
      2. EnemyProjectile
      3. PlayerProjectile
  2. Enemies

    • Broken down into different enemy classes which inherit from the Enemy class.

    • This is less verbose than the original switch statement used to construct different enemies depending on type given to the constructor.

    • They are now updated via the EnemyManager class, instead of being maintained in collection in the Main.cpp.

      See RIXA/Source/Manager/EnemyManager.cpp

      See in RIXA/Source/Actor/:

      1. Enemy
      2. TankEnemy
      3. TrackedEnemy
      4. TurretEnemy
      5. DroneEnemy
  3. Player

  4. Particles

    • Decided to expand the explosion effect functions into it’s own ParticleManager system.

    • This allows you draw a sprite animation at a given position. After it’s animation finishes, it destroys itself.

    • This is done for the damage and explosion effects in the game.

      See RIXA/Source/Manager/ParticleManager.cpp

  5. GameModes

    • Implemented class-based game states.

    • Helpful for reloading the game, as the Game.cpp deconstructor is used to free game-related heap memory.

      See RIXA/Source/GameMode/

Additions/Balancing

Here are some other additions I made outside of refactoring.

  1. Win/Lose States

    • You could only die in the original prototype.

    • Added win state when reaching the end of the level.

      See RIXA/Source/GameMode

  2. Restart

  3. Balancing

    • Enemy stats were reworked to make them feel different from each other.
    • Enemy bullet sizes now correlate to the amount of damage they deal.
  4. Camera Lerping

  5. Bullet Animations

  6. Sounds

    • Added shooting and hit sounds to make gameplay feel more impactful.

C++ Best Practises

  1. Replacing Enum DataType w/ Enum Class
    • For reasons mentioned in the SFAS Feedback.
    • Done for GameState and Direction enums.
  2. Replacing Pointers
    • Most functions or classes assumed the pointers used would not be null, so it made sense to swap them out with references where applicable.
  3. De-allocate Heap Memory
    • Re-implementation of new Projectile and Enemy classes meant they had to be correctly de-allocated.
  4. Const Correctness
    • For functions and inputs where applicable.

Structure

  1. Separate Functionality

  2. Folder Structure

    • With the addition of more classes, I had to re-organise the file structure to make it more navigable.

      See RIXA/Source/

Bugs

  1. Crashing Issues
    • Fixed illegal memory access crashes in the new implementation.
  2. Tracked Enemy
    • Fixed a bug where the ‘Tracked Enemy’ would appear as a giant turret.

Contributions

Thanks to the original team behind Rixa! It was a blast making this with them at the time. It was interesting to see how much I have improved over the monthes since then.

Here are the contributors to the base prototype:

Daniel Vasile

  1. Sound

Henry Ha

  1. Gameplay
  2. Enemy, AI
  3. Camera

Izzy Cassell

  1. XML level loader
  2. Level collisions
  3. Enemy, AI

Jake White

  1. Design
  2. Assets
  3. Music