Image source: pixabay.com
What is this project about?
Here is a list of bugfixes / features /improvements applied within the contribution:
Fixing Firebase issues
Game state is stored in Google's Firebase Realtime Database. The problem is that this does not allow us to store empty arrays and falsy values.
Thousand Card Game Logic specifies i.e.
battlePoints which sits in
players object. Initially it is assigned with an empty array, but firebase does not specifies it at all (as it's empty array). Game logic project (gornanization/1k) requires this value to be specified, so after loading state from Firebase, we have to make sure all data is well prepared before initialising the game. That's why new function
extendStateWithDefaults has been specified within the contribution. It fixes many cases issues caused by lacking object properties, while computing game state.
Increasing bid value
As you might know, just before a trick starts (during the share stock phase), the bidding winner can increase his bid value. In order to provide such capability we have to create UI for it. I created options panel for it, as presented below:
After clicking Bid button, a specific action request is being sent to the server.
Cards UI updated
Suit colors was applied for better appearance, as well as general card view. Changes applied below:
In order to improve overall client UX, I decided to sort cards. Cards are sorted by suit firstly (Hearts, Diamonds, Clubs, Spades) and eventually by rank (Ace first, Nine last). Whole cards list is also printed below the cards list, just as presented here:
More details? See PRs linked above.
- Thousand Card Game: Connecting to the game table
- Thousand Card Game: The battle is over...
- Thousand Card Game: Refactoring 'Card' Object
Posted on Utopian.io - Rewarding Open Source Contributors