joshuaauerbachwatson / anyCards

Multi-person card game with no built-in rules
Apache License 2.0
0 stars 0 forks source link

[client] Auto-show capability #19

Closed joshuaauerbachwatson closed 1 year ago

joshuaauerbachwatson commented 1 year ago

Currently, when playing, if you want other players to see what you've done before yielding, you touch "show". This can lead to capricious or inconsistent results. For example, while playing "war" a play can flip cards from each deck, then "show", then drag the cards to the correct discard pile, then "yield." But, he can also forget to do this and other players may be suspicious that he is violating rules behind their backs.

A possible direction is to eliminate the show button and instead have the game share the new state with all players at reasonable points such as just after a card is flipped or dropped or cards are shuffled or dealt.

joshuaauerbachwatson commented 1 year ago

It makes sense to do this prior to issue #21 because there will be a major revision to button layout in that issue and that will be easier and more lasting if the Show button is dropped first.

joshuaauerbachwatson commented 1 year ago

Auto-show has been implemented and the show button has been removed. The one tricky part was making sure drag recognizers only do a transmit when in the .ended state. Otherwise, there can be a flood of messages which overwhelm the server (if any) and the receiving apps. The cost of avoiding this problem is that the other players don't actually witness the entire drag: the card or deck simply moves from its starting point to its ending point.