top of page

Metal Slug (Remake)

About The Game

C++

Solo

Custom Engine

School Project

The purpose of this project ​was to apply all the concepts that I learnt during my programming course. The main focus was on the basic principles of a game like collision detection, sprites, animations, camera etc.

 

On the other hand, I had to apply and extend all my knowledge of object-oriented programming and C++, including aspects like templates, interfaces, polymorphism, standard library sequences and containers.

All of this needed to be demonstrated in a 2D Game of our choosing and only one level from the game was required. I decided to remake Metal Slug, the classic run and gun originally released for arcades.  In this game, players control a soldier as they shoot enemies, rescue prisoners, and collect weapon pickups.

What I Did

I remade the first level of the original Metal Slug. The main focus was on creating a program that is readable and maintainable by applying the principles and techniques from object-oriented programming and using the coding standards.

Overview

  • Transforming objects using opengl functions: Opengl functions were mainly used for operations like rotating sprites around their center, translating the camera, and scaling sprites.

  • Creating a SVG file from a level image file: The image from the level was converted to a Scalable Vector Graphics (SVG) by using InkScape program. ​This image can be read in by the code available in the framework and converted into a series of line segments. This can later be used to check collisions with the level.

  • Raytracing for Collisions: The framework provided some Raycast functions which I used them to detect collisions between the player and the environment, as well as between bullets and enemies.

  • Camera movement: A simple camera movement was implemented to automatically follow the player and to never leave the level boundaries. This was done by using OpenGL and translating the Modelview matrix.

CameraMetalSlug-ezgif.com-optimize.gif
  • Sprite Animations: Implemented multiple sprite animations for the main character, including shooting, crawling, jumping, aiming upwards, and dying. All world objects and the level background also have animations.

NewProject-MadewithClipchamp2-ezgif.com-video-to-gif-converter.gif
  • Sound and effects by using SDL_Mixer: Many actions in the game have a sound representation that is played or canceled when it is necesary. There is also music for the different stages of the game (Menu, playing the level and boss fight). The volume can be adjusted, turned on/off by keypresses or by using the pause menu.

bottom of page