So, this is a game that I have been working on for a while, and now that it's to version 2.0, I figured it was worthy to be posted on this forum. ;)
I used SFML for just about everything, the rendering, the bounding boxes, etc. I just created my own classes to represent the game world.
The point of the game is to destroy the army of oncoming squid. You control a turtle that can belch out fireballs. The goal is to get as many points as possible, and survive as long as possible. There are bosses, giant fireballs, and fish, so enjoy! ;D
This game has a pixel art graphics style. There are two main strategies you can go for: the best time and the high score. To go for the best time, you target the weak spots in the waves of squids, and basically survive as long as possible. To go for the high score, you destroy as many squids as you can, so you can rack up as many points as possible.
P.S. It only runs on Windows. I tested with Windows 7/10
The start of the game.
(https://www.dropbox.com/s/vv7wwrzf14atrc3/screen1.jpg?raw=1)
A scary boss!
(https://www.dropbox.com/s/z3bluy7calew5z0/screen2.jpg?raw=1)
View my code here: https://github.com/TheArduinist/Squid-Blaster.git
Download the executable here: https://www.dropbox.com/sh/voy1fxerr3nj56n/AADczvOvXBfwGbYfdgawS_wba?dl=1
Any suggestions are welcome! I'm a young programmer, so I'd be happy to hear an expert's opinion!
As for moving diagonally, how would you suggest implementing it? There are four arrow keys, so what would your recommendation be?
The usual way would be:
Up Arrow | - move up |
Up Arrow + Right Arrow | - move up and right |
Right Arrow | - move right |
Down Arrow + Right Arrow | - move down and right |
Down Arrow | - move down |
Down Arrow + Left Arrow | - move down and left |
Left Arrow | - move left |
Up Arrow + Left Arrow | - move up and left |
The combinations, therefore, would be:
↑ + → = ↗
↑ + ← = ↖
↓ + → = ↘
↓ + ← = ↙
fixed down-left arrow (it was a down-right arrow ;D)
Ah, you found the bottom to top thing. That does make the game a lot easier, I'm working on a way to fix it, but I need to keep it for now because every minute, one squid is added to the wave's "weak spot", so after ten minutes the game would become impossible without bottom to top teleportation.
Whoops, I guess I wasn't clear on the hovering bit. I mean the turtle has to touch the fish for a few seconds. I'll update the readme. Thank you for bringing this to my attention!
And thanks for the example graphics. I'll see what I can do.
Huh. I wasn't using the image boundaries for the turtle's bounding box, so it must be something else. Here's my code:
switch (this->direction)
{
case UP:
this->bounds = FloatRect(this->sprite.getPosition().x - 21, this->sprite.getPosition().y - 31, 40, 52);
break;
case DOWN:
this->bounds = FloatRect(this->sprite.getPosition().x - 19, this->sprite.getPosition().y - 21, 40, 52);
break;
case LEFT:
this->bounds = FloatRect(this->sprite.getPosition().x - 31, this->sprite.getPosition().y - 19, 52, 40);
break;
case RIGHT:
this->bounds = FloatRect(this->sprite.getPosition().x - 21, this->sprite.getPosition().y - 21, 52, 40);
break;
};