Stateless game design
Posted
by
L. De Leo
on Programmers
See other posts from Programmers
or by L. De Leo
Published on 2012-09-01T15:56:36Z
Indexed on
2012/09/01
21:49 UTC
Read the original article
Hit count: 222
I'm facing a challenge understanding how to program a web version of a card game that is completely stateless.
I create my object graph when the game begins and distribute cards to PlayerA and PlayerB so I lay them out on the screen. At this point I could assume that HTML and the querystring is what holds at least some of my state and just keep a snapshot copy of the game state on the server-side for the sole purpose of validating the inputs I receive from the web clients.
Still it appears to me that the state of the game is by its nature mutable: cards are being dealt from the deck, etc...
Am I just not getting it? Or should I just strive to minimize the side-effects of my functions to the objects that I take as my input? How would you design a stateless card game?
© Programmers or respective owner