The Game.

The game itself is pretty simple, the players can walk around to collect the green orbs to gain points.
There is no winning or losing in this game, as I wasn't focussed on it.

It is not finished yet, there are still problems with the game, for example:

-collectible not despawning correctly when a player leaves
-spawning too many collectibles
-the collecitbles disappearing and reappearing.

Multiplayer.

Multiplayer was the main focus of this game.


I had figured out how to post and request data from a database, and wanted to try creating a multiplay game with it.
From the beginning I knew that you should actually use sockets for multiplayer, but I wanted to try it anyway (although I do want to learn about sockets aswell).

I learnt a great deal about requesting and posting via this project, aswell as the time it takes to make a request,
which was the reason I went on to multithreading to speed the game up.
And if the request is to be processed, an API of some sorts is also needed, so I created a small API to process the request the game makes.

Server (substitute).

I did not create an actual server that would keep track of the game, so the game does that itself (as a substitute server).
It looks at what data (players and collectibles) it currently knows about, and compares that to what it receives from the database.
And based on that, it checks every collectible and player for where it should move, if it should still exists, what score it is, etc.

It also posts the changes that were made on it's own players game to the database, handles players quitting, and collectibles being picked up (although some of these are still work in progress).

Multithreading.

When I got most of the game working, it was lagging significantly.
To counteract this, I decided I wanted to learn how to use multithreading, reading up on it, and trying to implement it into the game.

After about 2 small but failed attempts, I felt I got the hang of it, and refactored most of the server and connections to work with the multithreading.
It's not perfect, but it was good enough for this project, and I will be implementing it in more projects to come, learning along the way.