For this mini-project, the assignment was to create a Rock Paper Scissors game using Javascript to practice what we've learnt about control flow, loops and DOM interaction. The game should allow the user to make their choice via clicking a button, generate a random choice for the computer player, display the running score, and announce a winner of the game once one player reaches 5 points.
Check out my attempt: https://robbailiff.github.io/rock-paper-scissors/
The assignment is part of The Odin Project curriculum, which is free and open source and uses on freely available resources in each of the modules. The ethos of the project is learning by building things, with the added bonus of creating projects that can be showcased in a portfolio.
Check out The Odin Project here.
This was quite a challenging but also very enjoyable project. There was an awful lot to take in from the DOM Manipulation lesson so it took some time to sit down and think about the best way to approach the problem. It didn't take me long to all to code out the basic logic but it did tae a bit of time to figure out the best way to organise the button logic. This did force me to think "in Javascript" because I had originally tried to embed the event listeners inside a while loop, as that is what I would do if I was making a similar game in Python. I then realised that wouldn't be necessary when I could instead simply embed the game functionality in the event listener callback. I spent about a day or so thinking about the project and then spent probably 10-15 hours working on it and refactoring the code.
I particularly enjoyed doing all the CSS styling and probably about 40% of the time spent on the project was spent on the visual design. The theme was inspired by 80s sci-fi movie computer terminals like those in Aliens film franchise, and also by the Pip-boy computer from the Fallout video game series. I learnt a lot about animations and their properties whilst creating the loading screen and the flicker effect, which were a lot of fun. Overall this was a great project from the course designers at The Odin Project that really reinforced the concepts that have been taught so far.