Yuzbir Okey in React
DEV DIARIES
Write a diary for each challenge you take
PLAN
-
8.13 : 3 Login
-
8.16 : 3 GamePlay
-
8.19 : 3 UserProfile
-
8.22 : 3 Tournaments
-
8.25 : 3 Leaderboard
-
Login
- add loading states
- add localstorage
-
Juice
- Add Color
- tween/scale stones etc
- table stones much smaller / stackable
- sounds/ radio
- add particles / smoke
- confetti game end
- stone stacks shown
-
GamePlay
- Fix layout
- Improve stones
- [+] Improve user cards
- Stone groups draggable
- stones not overlap
- stone groups count shown
- [0] total count shown
- middle stone count
- timer auto play
- enable click play
- add fake okey
- Fix layout
-
UserProfile
- add language switch
- Game stakes are applied
- User Profile dialog
- Clickable user links
- [ ]
BUGS
- put the new added stone first empty place
- groups z index messed at bottom
- transition is on when withdrawn middle
- scoreboard shows nan values
- discard stones shows very first instead of last
- transition glitch happens when drag last stone in stone group
- fix z index for open stones
- stone transition bug on open sequence
- throws on leave table
- custom drag layer throws when dragged non draggables
- draw left / open sequence / leave taken fail
- hover css style mess when dragging stones
- pair opening stone is removed by duplicate when left is same
- sometimes rooms don't get removed, probably caused by breakpoints
- drop on discard mini box area calculate wrong (row column)
- open sequence twice causes bug
- replace okey should replace higher order stone
- open sequence / open pairs / collect open rule and save bug
- open sequence / open pairs / can't open sequence again
- [+] open sequence and pairs implement server side
- two okeys doesn't make a group
- update max pair on player open seq/pair
TODO
-
Other
- add version to the main menu
- add online user counts
- make player names as link
- show toast for open seq cases
- add room name to room options
- improve lobby
- make table sit randomly
- reset on round end
- [+] improve user lighten colors and highlight current player
- add useful error messages to chat
- add this http://api.adorable.io/avatars/285/abott@adorable.io.png
-
Refactor
- remove player logic from okeytablecenter
-
Functionality
- dnd pieces
- dnd for stone group
- add game end state and countdown
- add rules for can drag/drop can open sequence/pairs
- add game state, options
- add disconnected case handle errors
- add dev tool component to iterate individual component
-
CSS
- add stone
- seperate okey-stone okey-stone-draggable components
ISSUES
- Add lobby games table
- Add tests for PLAYER_ actions
- Fix case When opened sequence and opened pairs on the same turn
- Fix leave taken player
Discussion
What To Have In Game Toolbar
- [Room Name] [Round 1/3] [Stake] [IsFast]
- Current open state
How to open stones and process meanwhile
- User opens stones
- User process stones to self
- User process stones to others
- Collect open
- Discard with open stones
State is stones
and sequence
.
- Save
stones
andsequence
and set them new values - Each stone on
sequence
has dirty flag set to true if has self opened groups on the same turn and processed to a group with a group owner. - Each group on
sequence
has a group owner, except self opened groups on the same turn - Restore
stones
andsequence
on collect open - Add each dirty stone to
prematureProcessStones
, send the stones with no group owner as open groups
How to keep track of rules
State: canWithdraw
, canDiscard
, canOpenPairs
, canOpenSequence
, canProcessStone
, canCollectOpen
, canLeaveTaken
Actions: withdrawLeft
, withdrawMiddle
, discardStone
, processStone
, openSequence
, openPairs
collectOpen
, leaveTaken
withdrawLeft
-> canWithdraw
-> isMyTurn
, hasWithdrawnThisTurn
withdrawMiddle
-> canWithdraw
-> isMyTurn
, hasWithdrawnThisTurn
openSequence
-> canOpenSequence
-> isMyTurn
, canWithdraw
hasOpenedPairsThisTurn
, hasOpenedPairsThisRound
openPairs
-> canOpenPairs
-> isMyTurn
, canWithdraw
hasAnyoneOpenedPairsThisRound``
collectOpen->
canCollectOpen->
isMyTurn,
hasOpenedPairsThisTurn,
hasOpenedSequenceThisTurnleaveTaken
->
canLeaveTaken->
isMyTurn,
hasWithdrawnLeftThisTurndiscardStone
->
canDiscard->
isMyTurn,
hasWithdrawnThisTurn,
hasWithdrawnLeftThisTurn,
hasOpenedSequenceThisTurn,
hasOpenedPairsThisTurn,
discardOpenSequence->
canCommitOpenSequence-> canCommitOpenSequence(sequence)
discardOpenPairs
-> canCommitOpenPairs
-> canCommitOpenPairs(pairs)
processStone
(stone) (group) -> hasOpenedPairsThisTurn
, hasOpenedSequenceThisTurn
, canProcessStone(stone, group)
- GameRulesStore
- Properties
currentTurn
hasWithdrawnThisTurn
hasWithdrawnLeftThisTurn
hasOpenedPairsThisTurn
hasOpenedSequenceThisTurn
hasOpenedPairsThisRound
hasOpenedSequenceThisRound
- Computed Properties
isMyTurn
canWithdraw
canDiscard
canOpenPairs
canOpenSequence
canCollectOpen
canLeaveTaken
- Properties
Undecided Concerns
- Can a player open sequence and open pairs on the same turn?