/baldertext

An SMS-variant of a classic board game, Balderdash!

Primary LanguageJavaScript

Baldertext

BalderText is an SMS-variant of a classic board game named Balderdash. It offers an additional way to engage with friends and family from a distance. The game is built in JavaScript using Twilio Functions and can be easily deployed using the Serverless toolkit.

To play with your own group, follow the instructions below in Deploy your own BalderText game and use the Gameplay instructions to get started quickly.

Gameplay

Objective

The goal of BalderText is to write a fake definition for an uncommon word that is convincing enough that the other players believe it is the real definition. Players receive points when other players choose their fake definitions and when they successfully choose the real definition. After 4 rounds, the player with the most points wins!

Scoring

Each player who chooses the real definition gets 2 points
Each player gets 1 point for every other player who chooses their fake definition

How to Play

BalderText supports 2-8 players.

  1. Every player texts ‘Join game’ to your game number with a username. When all players have joined, one player kicks off the game by texting ‘Start game’ to the game number.
  2. All players receive the same word in a text, with a prompt to generate a fake definition for the word that other players will be likely to pick. The players are prompted to respond with their made-up definition.
  3. Once everyone has submitted their fake definition, all players receive every submitted definition as well as the real definition (in random order). Each player votes on which definition they think is the real one.
  4. After scoring, the round ends and the game sends a score summary to each player before starting the next round.
  5. After 4 rounds, the game ends and the player with the most points wins.

Commands

These are the commands you can text to your configured BalderText number:

Command What does it do?
Join game <username> Adds the messager to the game as the provided username, or as their phone number if no username is provided.
Start game Begins the first round of gameplay. No new players can join the game while it is active.
End game Stops and removes the active game, if there is one. Players have to rejoin using the Join game command before starting a new game.
<definition> Submits a definition for a player. Punctuation and capitalization is preserved in the player's response.
<number> Logs the player's vote for the definition with the number submitted.

Deploy your own BalderText game

Requirements

  • Node version 10 or greater, and NPM (included in the Node installation bundle).
  • A free or paid Twilio account. You'll need the account SID and the auth token for your .env file.
  • An Oxford Dictionaries API Key to fetch word definitions. You can sign up for free 'Prototype' credentials here. You'll need the Application ID and Application Key for your .env file.

Deploy

  1. Clone this repository git clone git@github.com:eshenfield/baldertext.git to your machine.
  2. Run npm install inside the BalderText directory to set up the Twilio Serverless toolkit.
  3. Rename the included .env.example file to .env and replace the XXXX placeholders with the credentials you gathered above.
  4. Run npm run deploy to deploy your Baldertext instance using the Twilio Serverless toolkit. It should take a minute or two, and when the deploy is complete, it will list out the Deployment Details in your terminal. Copy the url listed under "Functions" (it should end in '/game') and save it for the next step.
  5. From the Twilio console, configure your phone number to respond to incoming messages with a Webhook that makes an HTTP Post request to the URL you saved in step 3.
  6. Try texting 'join game' to your number to make sure everything is working!

Run BalderText locally on your own system

You might want to add additional functionality or play around with the existing code. To do so, you can run BalderText locally and tinker with the game!

Requirements

  • Node version 10 or greater, and NPM (included in the Node installation bundle).
  • ngrok -- this utility connects the development version of BalderText running on your system to a public URL that Twilio can connect to. You can download a copy for Windows, MacOs, or Linux here.
  • A free or paid Twilio account. You'll need the account SID and the auth token for your .env file.
  • An Oxford Dictionaries API Key to fetch word definitions. You can sign up for free 'Prototype' credentials here. You'll need the Application ID and Application Key for your .env file.

Run

  1. Clone this repository git clone git@github.com:eshenfield/baldertext.git to your machine.
  2. Run npm install to install the required project dependencies.
  3. Rename the included .env.example file to .env and replace the XXXX placeholders with the credentials you gathered above.
  4. Run npm run start to start your server.
  5. Start up ngrok to expose http://localhost:3000 at a different .ngrok.io url.
  6. From the Twilio console, configure your phone number to respond to incoming messages with a Webhook that makes an HTTP Post request to your-ngrok-domain.ngrok.io/game.
  7. Try texting 'join game' to your number to make sure everything is working!