I wanted to add a feature to digitalicebreakers.com that would let the presenter randomly select a member of the audience. I came up with the idea of the audience member’s names floating around the screen and gradually fading out, leaving only the winner.

Initially I thought this would only take me an hour to implement, but a number of edge cases meant I wrote a bit more than I was expecting.

Never-the-less, it’s complete now and includes the following features:

  • Audience names appear in random colours and bounce around the screen
  • When the presenter selects Pick, the names that weren’t picked are faded out over five seconds, leaving only the winner
  • After the five seconds, the audience’s devices update to show a green background and a winning message in the case of a win, and a red background in the case of a loss
  • If the audience joins, or leaves, while the game is running, they will appear/disappear on the presenter’s screen immediately.
  • The pick is cached on the backend, so if an audience member refreshes their device, it will update with their current pick status
  • Refreshing an audience device changes their random cololour on the presenter’s screen
  • If an audience member’s name is too long, it will appear smaller than other names on the presenter’s screen

digitalicebreakers.com | source