Skip to content

gbejarl/classgame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Class Game (Family Feud Style)

A classroom game designed for interactive play, inspired by Family Feud. The game features a student-facing "Board" view and a teacher-facing "Host" view to manage the state of the game, reveal answers, and award points.

Installation

Prerequisites

  • Python 3.7 or higher
  • pip (Python package installer)

Setup Instructions

  1. Clone or Download the Repository: Ensure you have all the files in your local directory.

  2. Create a Virtual Environment (Recommended):

    python3 -m venv venv
    source venv/bin/activate  # On macOS/Linux
    venv\Scripts\activate     # On Windows
  3. Install Dependencies: Install the required Python packages using pip.

    pip install -r requirements.txt

Running the Game

  1. Prepare Game Data: Make sure you have a game_data.json file in the root directory of the project (the same folder as app.py). See next section on how to create it.

  2. Start the Server:

    python app.py

    The server will start on port 5001. See next subsection for hyperlink.

  3. Open the Game Views:

    • Game Board (Students' View): Open a web browser and navigate to http://localhost:5001/. Project this screen for the class to see.
    • Host Panel (Teacher's View): Open another tab or device and navigate to http://localhost:5001/host. Use this panel to control the game.

Writing the game_data.json File

The game relies on a game_data.json file to load questions, answers, and points. The file consists of two main sections: classic rounds (multiple answers) and lightning rounds (a single correct answer).

Here is an example of the structure:

{
  "classic": [
    {
      "label": "Round 1: Animals",
      "question": "Name an animal you might find at the zoo.",
      "answers": [
        { "text": "Lion", "points": 40 },
        { "text": "Elephant", "points": 30 },
        { "text": "Monkey", "points": 20 },
        { "text": "Giraffe", "points": 10 }
      ]
    },
    {
      "label": "Round 2: Colors",
      "question": "Name a primary color.",
      "answers": [
        { "text": "Red", "points": 50 },
        { "text": "Blue", "points": 30 },
        { "text": "Yellow", "points": 20 }
      ]
    }
  ],
  "lightning": [
    {
      "label": "Lightning Round 1",
      "question": "What is the capital of France?",
      "answer": "Paris",
      "points": 100
    },
    {
      "label": "Lightning Round 2",
      "question": "What is 5 + 7?",
      "answer": "12",
      "points": 50
    }
  ]
}

Data Fields Explained:

  • classic Array: Contains the standard rounds (multiple answers).

    • label: The name of the round shown in the host's drop-down menu.
    • question: The main prompt/question for the round.
    • answers: A list of objects, each containing:
      • text: The answer string to be revealed on the board.
      • points: The numeric point value awarded for guessing the answer.
  • lightning Array: Contains lightning rounds (typically with just one correct answer).

    • label: The name of the round shown in the host's drop-down menu.
    • question: The prompt for the lightning round.
    • answer: The correct answer string.
    • points: The numeric point value awarded for getting the answer right.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors