crobertsbmw / deckofcards

An API to simulate a deck of cards
MIT License
1.34k stars 335 forks source link

hide cards from other player #72

Closed peterdri closed 4 years ago

peterdri commented 4 years ago

For a two player game, how do you see your own cards, but hide them from the other player?

peterdri commented 4 years ago

In other words, after dealing the cards, how can I look at my cards without the other player able to look at them?

crobertsbmw commented 4 years ago

That needs to happen on the frontend. The api doesn't show or hide cards; it just manages the deck. If you are creating a game with two players (on different computers, rather than standing next to eachother on the same computer), you will need a server. The server could make calls to deckofcardsapi, and could then send messages back to the client with which cards they have and handle all the game logic.

On Sun, Mar 15, 2020 at 8:12 PM peterdri notifications@github.com wrote:

In other words, after dealing the cards, how can I look at my cards without the other player able to look at them?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/crobertsbmw/deckofcards/issues/72#issuecomment-599306370, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMQLHT2GSSVFLLZR6ID5ELRHWDJHANCNFSM4LLTGGYA .