Game view with enemies, player, scores and a timer
Health and Armour decrease when hit
End screen with win score, your score and high score
GIF of the game in action
Team Size: 2 My Role: Programmer Tools: SDL 1.2 Language: C++ Time Taken: 1 Month
Shotgun is a 2D shooter, made in the first year at the University of Bolton as part of the Introduction To Games Programming module. Over the course of the month, it was created by a team of 2 using SDL and C++.
During development, I was assigned roles in order to complete the game to a good standard. The roles which I was assigned to are:
Health & Armour bar that displays above each player
Buttons with hover effect
What went well?
Strong Team Communication
Throughout the project, we maintained a very strong team communication at all times. This made development easy as we were able to know what everyone was working on and we were able to assist with any errors that other team members might be having.
Met The Deadline
In the month provided, we were able to complete the game including documentation to go along with it.
The game that we had planned came out just as expected and also met our assignment criteria.
After the game was submitted, we recieved better than expected results for the game.
What can be improved?
Adding more levels to the game would make it less boring and give the player more to do.
Better Enemy AI
In the current build, the AI is very basic. To improve on this we could give the enemies A* pathfinding aswell as a targeting system.
Score Per Kill
Rather than score per shot, we could change it to score per kill to make it more interesting rather than adding point everytime an enemy is hit. This will make the game more skill based.
Currently we don't have any animations, to improve on this we can add some enemy and player movement animations in to make the game more polished and interesting for the player.
Health and Armour Bar Update:
This code sample deals with the health and armour bar. When the player is hit, one will decrease.
void GhostHunter::updateHealth(character &player, int healthChange)
if (player.getArmor() <= 0) //if player has no armor
player.setHealth(player.getHealth() - healthChange); //decrease health by healthChange
player.m_healthBar.frames->w = player.m_healthBar.frames->w - (healthChange / 2);
player.setArmor(player.getArmor() - healthChange); //otherwise decrease armor by healthChange
player.m_armorBar.frames->w = player.m_armorBar.frames->w - (healthChange);
Mouse Button Click:
A code sample that deals with button clicks on UI buttons. Checks to see if the mouse is inside the button and then checks for a click.