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

GEMU NAMAE


Game thumbnail
Developer: Kyle Thomas (solo)
My Role: Programmer
Tools: SFML 2.3.2
Language: C++
Time Taken: 2-3 days
Jam: Ludum Dare 36
Theme: Ancient Technology


Game Overview

Gemu Namae is a 2D platformer made for Ludum Dare 36 with the theme, "Ancient Technology". I decided to use C++ with SFML in order to challenge myself and push my learning some more. The aim of the game is to decend into the depths and avoid taking damage from the enemies that throw ancient daggers at you. As the player you can block shots and kill enemies with the whip.

What went well?

  • Block Spawning
    • It isn't perfect however, the block spawning came out quite well considering how much time I had. The blocks spawn in a 32x32 grid formation with gaps in between and at random to give the player a sense of re-playability.
  • Great feedback
    • After the game was submitted, feedback was received by the Ludum Dare community both positive and constructive. This helps out because I can see what I am doing right and what can be improved on in future.
  • Meeting the deadline
    • During the jam I was able to finish the game in time for submission. This was great because I went for the C++ route to challenge myself some more rather than using Unity. I was able to start from bare bones and have a playable game by the end of it.


What can be improved?

  • Artificial Intelligence
    • Although the AI works and shoots daggers towards the player, it isn't what I quite wanted due to time constraints. In the polished version, I will be improving upon the AI to recognize the player better and to take gravity into consideration.
  • Audio
    • Due to time constraints I was unable to get audio added to the game, I will be improving this in my next release which will be more polished than my submission.
  • Animations
    • Again time was not on my side with this Ludum Dare so animations weren't added in, but with my next version of the game, there will definitely be some animations as it gives the game polish and makes it visually appealing.
  • Collision
    • Collision was a slight issue with the game during development, such as the player bouncing up and down fast or if you dropped down, side collision didn't work as intended so the player got stuck. Which led me to make it so the player couldn't strafe mid air when they fell. I will be improving upon this in later releases as restricting the player like that isn't in my nature.

CODE SAMPLE


Block and Enemy spawn:

A code sample that deals with block spawning and enemy spawning by setting their position on a grid and then pushes them to a vector.
void Game::Setup()
{
	for (int x = 0; x < SOLID_WIDTH; x++)
	{
		for (int y = 0; y < SOLID_HEIGHT; y++)
		{
			block_sprite[x][y].setTexture(block_texture);

			if (SpawnSolidBlock() == true)
			{
				//set block_sprite pos to a 32x32 grid
				block_sprite[x][y].setPosition(x * 32, 32 + (y * 64));
				block_vector.push_back(block_sprite[x][y]);

				if (SpawnEnemyOnBlock() == true)
				{
					//spawn enemy on block if there is a solid block and bool == true
					e1 = new Enemy("img/enemy1.png");
					e1->set_pos(x * 32, block_sprite[x][y].getPosition().y - e1->getHeight());
					enemyVector.push_back(e1);
				}
			}
		}
	}
}
		

Object collision:

A code sample that deals with removing objects from the game when collision occurs. Below is the code used specifically for erasing the enemy and daggers.
		for (enemyiter = enemyVector.begin(); enemyiter != enemyVector.end(); enemyiter++)
		{
			//whip collision with enemy
			if (whip_sprite.getGlobalBounds().intersects((*enemyiter)->getSprite().getGlobalBounds()))
			{
				player.addScore(10);
				enemyVector.erase(enemyiter);
				break;
			}

			for ((*enemyiter)->dagger_iter = (*enemyiter)->dagger_vector.begin(); (*enemyiter)->dagger_iter != (*enemyiter)->dagger_vector.end(); (*enemyiter)->dagger_iter++)
			{
				//whip collision with dagger
				if (whip_sprite.getGlobalBounds().intersects((*enemyiter)->dagger_iter->getGlobalBounds()))
				{
					player.addScore(1);
					(*enemyiter)->dagger_vector.erase((*enemyiter)->dagger_iter);
					break;
				}

				//dagger collision with player
				if ((*enemyiter)->dagger_iter->getGlobalBounds().intersects(player_sprite.getGlobalBounds()))
				{
					player.takeDmg(1);
					(*enemyiter)->dagger_vector.erase((*enemyiter)->dagger_iter);
					break;
				}
			}
		}