Two players card game

39 views
Skip to first unread message

Eugene Badin

unread,
Sep 5, 2014, 7:20:14 PM9/5/14
to rubyonra...@googlegroups.com
I need to implement a card game between two players. A player clicks
"bet" button, then a game appears in queue list and another player
clicks "join" button, and then the game starts. Technologies I use
include Rails 4, websocket-rails, jQuery. What I'm confused about is how
to show each player their own cards and to not show the opponent's cards
on the board. What technique is being used for this purpose? I think I
should use internal websocket-rails' connection_store method to store
players' cards, but I'm not sure how to work with it later in game and
how to store each player's cards in variables

Has anybody here have this kind of experience with websocket-rails? Any
advice? May be there is implemented card game on rails somewhere, some
code of which I could borrow?

--
Posted via http://www.ruby-forum.com/.

Jason Fleetwood-Boldt

unread,
Sep 7, 2014, 4:39:55 PM9/7/14
to rubyonra...@googlegroups.com
Sounds like a complicated (but cool!) project.

Maybe you should build a small prototype with just some of the basics of websocket-rails so you understand how some of the client-side vs. storage-side concerns are handled.

Or, if you have questions specific to that gem, post them to the Gem page.

I think your question is so broad and at the same time somewhat vague that what you're really asking is how to architect the app.
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/29f2a741909c1bba014b51faf317d765%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.
>

Eugene Badin

unread,
Sep 8, 2014, 9:32:27 AM9/8/14
to rubyonra...@googlegroups.com
Thank you for responding. Since the time I asked the question I learned
some stuff by myself and wrote a gomoku game :) but it doesn't work as
expected, namely throws an error. I made another thread about it
Reply all
Reply to author
Forward
0 new messages