Greetings,
Last time, I gave an update on my progress. I'm pleased to say I've made a PR and I'm waiting for the maintainer to approve it.
To solve the issue I mentioned previously about communicating between different parts of the program I opted to use the EventEmitter pattern which involves emitting events and having preset functions to respond to those events. This is very similar to how events such as clicks or button presses are handled in the DOM. Once I created a class to implement this pattern I realized that I could simply many parts of my existing code to use this pattern. Such as an event for when the game ends.
I also reworked the time tracking class to not only differ between long and short presses, but to also track duration. This allowed me to add a timer showing the player how long it took them to complete the game. I also wanted to have a scoreboard with the best times, but I felt it was out of scope as it was a single-player game only so it would only have the players scores.
The last thing I added were some win and loss effects using ZzFX a tool I had not used previously, but I think I will use more going forwards as it has a lot of functionality and a small file size.
Overall, I felt I got to add everything a minesweeper game has, randomly placed mines, numbers showing the adjacent mines, ability to reveal squares and place flags, as well as a game timer, and win/loss screens. Starting from release 0.2 to 0.4 it was very exciting to work with this engine and build increasingly large projects, to end with a fully working game. It is quite satisfying.
Top comments (0)