Cowboy is a responsive multiplayer game for everyone to play, that I developed for fun. On Cowboy you can play one of two roles (see details)
where both sides have a semi-fair chance to win!
The whole development of the game (Frontend & Backend & DevOps) highly strengthed my experience on those subjects and I am glad that I actually managed to finish this project.
๐ A tip on finishing visual projects: start with the logic (backend) and a basic ui and start working on the design only you get the base down working
This multiplayer game is based on the communication between the players, and this is done using Websockets.
The clients are using the browser's native WebSocket API
and the server is using the famous Websockets Library
in Python.
The frontend was developed with ๐ฐ Vue
& ๐ Vuetify
. A little bit of ๐ JQuery
is used too.
The website's server runs on a (DigitalOcean) ๐ Ubuntu
Droplet.
The websocket server also runs on the same machine and powered by Python 3.9 using the websockets library.
A your-website-subdomain.web.app
domain is freely available by ๐ฅ Firebase Hosting
(Static sites only), Github Pages is a great option too.
I also managed to set up the game on a custom domain and this was done by setting it on digialocean's dns resolvers and configuring the web server via ๐ฅ Nginx
(see details including SSL setup).
When you play you can choose your role - ๐ฎ Cows or ๐ถ Dogs. This allows a fun diversity and game style change.
The goal of the cows side is to go over the river (on the other side).
The game starts with 11 cows on the first row and on each turn the player can move a cow one step forward.
Be aware that cows can be eaten by the King (diagonally) and blocked by the Dogs.
As the cows, you have the advantage of the crowd - try to confuse the King and the Dogs with this.
The goal of the dogs side is to take all the cows down before one of them goes over the river.
The game starts with a King in the middle of the first row and 4 dogs surrounding it (2 to the right & left)
The Dogs can move like a Chess Rook (any amount forward or to the sides) and they can block the Cows from going forward.
The King is everything, it eats the cows, but it can only do it diagonally. It moves like a Chess King (one to any of the 8 sides surrounding it)
Be aware that you are unlikely to take down a cow with the king alone = use your Dogs to stop them from going forward and only then attack.
The game is fully functional but new improvments could always be added!
- โ Turn timer (currently there is no turn-timer and games can last forever :P)
- ๐ค Playing against bots (with difficulties - easy, fair or impossible)
- ๐ Game themes (changes the board colors, pieces and sounds)
I tried to make the game cheating-proofed but I would love to see someone find a way to win the game in a special win!
For some reason I find it hard to believe that this game is fair (it seems that winning with the cows is easier), though it was never proofed! Feel free to try to convince me which side has a better chance of winning.
If you want to contribute to the project and make it better, your help is very welcome (see guide).
If you don't feel like conding, feel free to post suggestions / bugs in the Pull Requests section!