KYLE THOMAS
Game Programmer | Contact: kyle.j.t@live.co.uk

SHOTGUN


GIF of the game in action
Team Size: 2
My Role: Programmer
Tools: SDL 1.2
Language: C++
Time Taken: 1 Month

Game Overview

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++.

My Roles

During development, I was assigned roles in order to complete the game to a good standard. The roles which I was assigned to
are:
  • Pause screen
  • Menu screen
  • Points bar
  • Health & Armour bar that displays above each player
  • Buttons with hover effect
  • Documentation


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.
  • Expected Result
    • The game that we had planned came out just as expected and also met our assignment criteria.
  • Great Feedback
    • After the game was submitted, we recieved better than expected results for the game.


What can be improved?

  • More Levels
    • 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.
  • Animations
    • 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.


CODE SAMPLE


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[0]->w = player.m_healthBar.frames[0]->w - (healthChange / 2);
	}
	else
	{
		player.setArmor(player.getArmor() - healthChange); //otherwise decrease armor by healthChange
		player.m_armorBar.frames[0]->w = player.m_armorBar.frames[0]->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.
	
	if (cursor.bb_collision(resumeBtn) && getMouseClicked() == true && getPaused() == true)
	{
		setPaused(false); //resume game
		pauseBg.set_visibility(false); //make pause screen invisible
		resumeBtn.set_visibility(false);
		restartBtn.set_visibility(false);
		quitBtnP.set_visibility(false);
		pauseTimeEnd = SDL_GetTicks();
		difference += (pauseTimeEnd - pauseTime);
	}