Coup

Aug. 8, 2021

Introduction

Coup is a card game I have been wanting to try and code for a long time now. I was introduced to it by one of my closest friends and it has been ever since one of the greatest card games/game I have ever played.

The game revolves around four champions, mainly the Ace, the King, the Queen and the Jack, while all other cards are coins.

I won’t go over all the rules right now, as this post intends to summarize the thoughts that led to my choices of the used technologies and programming languages and frameworks.

Making a choice

As it is always the case in computer science, one has endless choices when it comes to the technologies one can use.

For Coup, I could, for example, go with the Godot game engine, Android Studio, or Unity. I could have also went with any programming language really, like C++, Java or Python.

The choice I made to bypass all these and go with JavaScript was based upon my willingness to keep leveling up my web development capabilities, but also because I did not want to rely on any engine but use a programming language for the task at hand.

Another reason was that I found a great code example to inspire me through my card-game coding, but also be the basis of the work I will do : Enter cards.js

I found this library charming, because it is so simplistic, yet embodies every basic action one could do with a deck of cards. Go to the website, and try it out, it is awesome !

Working on Coup and how I wish to progress

As every at-first-complex-seeming-problem should be approached, I decided to cut my task into many smaller simple tasks.

First, I will write a simple single player card game to get accustomed to the card.js library, but also game development in js.

Then, I am going to attack a harder problem: a two-players game where I will have to set up the connection between the two players, and make their progress and actions visible to one another.

Finally, I will expand my knowledge and the already existing code to write coup, which I will make as a 4 players game.

All the progress will be shared throughout this post, which will thus be long, but organized in a way to be easier to read (I hope).

Single player game (coming soon)