KevinBongart / cards_against_humanity

An unofficial online version of the Cards Against Humanity game.
https://www.cardiganshumility.online
Other
41 stars 13 forks source link

Allow players to swap out answer cards they don't like #55

Open FriendlyWP opened 4 years ago

FriendlyWP commented 4 years ago

Sometimes you get an answer you just don't even understand, and it would be great to be able to swap out those cards and get a new one from the deck. :)

KevinBongart commented 4 years ago

Good idea! From the official rules:

If a player must shed a white card due to ignorance of its content, they must announce it to the whole group, and be shamed for their lack of being in the know. Humiliation is encouraged.

I'd love to find a way to make this happen in this virtual game. There's no activity log or popup or anything currently, but I'm picturing a flash at the top of the page that says something like:

Kevin doesn't know what "Swooping" means, so they picked a new card.

And a button to close that warning, so that each player sees and does something about it.

The copy would need to work for longer cards as well, and the UI needs to work even if all players start swapping cards left and right, and we'd also need to figure out what the process of picking a card to swap looks like.

What do you think, @FriendlyWP?

FriendlyWP commented 4 years ago

@KevinBongart I think that's a fantastic idea! I agree the UI will be a challenge, both in terms of layout and queuing up & displaying multiple actions as players all decide to do this simultaneously. Maybe you could limit it to one swap per round per player to help with that.

In terms of choosing a new card, maybe you could add a little 'swap' icon at the very top right on each card? There are a bunch of options on FontAwesome that could work: https://fontawesome.com/icons?d=gallery&q=swap

Then when it's clicked, a "You're about to swap this card and be shamed in front of all your friends, are you sure, loser?" type notice could come up with a confirmation button, and the card would be swapped to a random new one.

Does that help? I absolutely love the game you've made by the way, thank you so much! I played it with friends over the weekend and other than some loading issues it was AMAZING. You're so good! :)

haviduck commented 4 years ago

Good idea! From the official rules:

If a player must shed a white card due to ignorance of its content, they must announce it to the whole group, and be shamed for their lack of being in the know. Humiliation is encouraged.

I'd love to find a way to make this happen in this virtual game. There's no activity log or popup or anything currently, but I'm picturing a flash at the top of the page that says something like:

Kevin doesn't know what "Swooping" means, so they picked a new card.

And a button to close that warning, so that each player sees and does something about it.

The copy would need to work for longer cards as well, and the UI needs to work even if all players start swapping cards left and right, and we'd also need to figure out what the process of picking a card to swap looks like.

What do you think, @FriendlyWP?

I added a toast on a switch card event that broadcasts to the game. it works great and will be a fun addition. making a pr of it.

By the way, hows ruby on dynamically injected content? instead of refreshing pages, could we work some ajax magic into it?

KevinBongart commented 4 years ago

By the way, hows ruby on dynamically injected content? instead of refreshing pages, could we work some ajax magic into it?

I'm trying to keep the application architecture simple while possible, with only one type of rendering (server-side currently). Adding AJAX would split the game logic and the rendering logic between frontend and backend, so we'd need to see the value far outweigh the added complexity.

There's Stimulus.js all set up, it's a very minimal JavaScript framework that integrates well with Ruby on Rails.

Eventually I'd love to set up the app so that there's server side rendering triggered by events, running in Sidekiq, streamed to all players of a game, and Stimulus can use it to replace the HTML content