Grid Capture
A few days ago I built a simple game called Grid capture. It was more of an excuse for me to begin tinkering with HTMl5 and javascript, since I’ve never really used either before.
Purpose: The purpose of the game is quite simple. You play with another person, and each person gets a turn. On their turn, they are allowed to select one un-captured line on the grid. This line belongs to them. When a player captures a line which creates a complete square, they have captured a square. They also get another turn. Otherwise, it is the other player’s turn.
The code right now is functional, but quite messy. It was my first time working with javascritp and it is so simple! I had a bit of a hard time figuring out how to properly manage OOP in it, and I still don’t think I have done it right. I’ll definitely revisit this code again for refactoring.
The game currently only supports 2 players, but I’ve designed it in such a way such that it may be usable for any number of players. I also need to change the HTML page so that it can accept user input to change the size of the grid for each game, the players’ names, colours etc. Hence it is very much a WIP. But for the most part it is complete. I’ll upload a GitHub.IO page when I get a chance for a proper demo.
The code can be checked out at Git Hub if anyone is interested. :)
Edit
: I’ve created a simple demo site for this. It can be found right here