-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
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.
…layer management and UI
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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 ingame.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';
…functionality and UI consistency
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>
…tDisplay, ScoreBoard, and types
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:
src/components/game/AnswerButtons.tsx
: Introduced a button grid for selecting answers, with dynamic styling and event handling for user input.src/components/game/FactDisplay.tsx
: Added a component to display trivia facts with a styled container.src/components/game/PlayerSetup.tsx
: Created a form for setting up players, including input validation and dynamic player count handling.src/components/game/ScoreBoard.tsx
: Implemented a scoreboard to display player names and scores in a styled list.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 likePlayerSetup
,GameArea
, andScoreBoard
.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
, andMilitaryBranch
) to support the game's structure and logic.