Skip to content

Feat/military trivia game scaffold #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 31, 2025

Conversation

jeromehardaway
Copy link
Contributor

This pull request introduces a complete implementation for a "Military Trivia Game" feature. It includes new components, game logic, and data integration to create an interactive trivia experience. The most significant changes are the addition of reusable components for game functionality, the integration of trivia data, and the implementation of the main game page.

New Components for Game Functionality:

Game Page and Logic:

  • src/pages/game.tsx: Implemented the main game page, including player setup, trivia question display, answer handling, feedback, and game state management. Integrated components like PlayerSetup, GameArea, and ScoreBoard.

Supporting Data and Types:

  • src/data/militaryFacts.json: Added a JSON file containing trivia facts and answers related to U.S. military branches.
  • src/utils/types.ts: Defined new TypeScript types (Player, Fact, GameState, and MilitaryBranch) to support the game's structure and logic.

google-labs-jules bot and others added 2 commits May 31, 2025 20:05
This commit introduces the initial scaffolding for a military trivia game.

Includes:
- TypeScript type definitions for Player, Fact, and GameState.
- JSON data structure for military facts.
- Modular React components: PlayerSetup, GameArea, FactDisplay, AnswerButtons, and ScoreBoard.
- A new /game route using Next.js pages.
- Basic game logic for player setup, displaying facts, handling answers, tracking scores, and progressing through questions.
- Styling with Tailwind CSS using the Vets Who Code theme colors (Navy Blue, Red, White).

The game allows up to four players, presents facts sequentially, provides feedback on answers, and displays a scoreboard.
@jeromehardaway jeromehardaway requested a review from Copilot May 31, 2025 20:37
Copy link

vercel bot commented May 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vets-who-code-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2025 9:16pm

@jeromehardaway jeromehardaway self-assigned this May 31, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR scaffolds a Military Trivia Game by adding new data, types, components, and the main game page to run trivia rounds.

  • Defines TypeScript types for players, facts, game state, and military branches
  • Adds JSON data for trivia facts
  • Implements UI components (PlayerSetup, GameArea, ScoreBoard, FactDisplay, AnswerButtons) and the main game logic in game.tsx

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/utils/types.ts Added Player, Fact, GameState, and MilitaryBranch types
src/data/militaryFacts.json Introduced trivia facts and correct branch answers
src/components/game/PlayerSetup.tsx Created player setup form with dynamic inputs and validation
src/components/game/ScoreBoard.tsx Implemented scoreboard UI for player scores
src/components/game/FactDisplay.tsx Added component to display a trivia fact
src/components/game/AnswerButtons.tsx Added answer choice buttons for branches
src/components/game/GameArea.tsx Composed fact display, answer buttons, and feedback
src/pages/game.tsx Main page wiring game state, flow control, and components
Comments suppressed due to low confidence (1)

src/components/game/GameArea.tsx:1

  • [nitpick] New UI components like GameArea lack accompanying unit or integration tests. Adding tests will help ensure game logic and rendering behave as expected.
import React from 'react';

jeromehardaway and others added 4 commits May 31, 2025 17:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jeromehardaway jeromehardaway merged commit 8677091 into master May 31, 2025
3 checks passed
@jeromehardaway jeromehardaway deleted the feat/military-trivia-game-scaffold branch May 31, 2025 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant