Add new brain game: Bullet Math#112
Conversation
|
@aleenaharoldpeter is attempting to deploy a commit to the ajaynegi45's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
👋 Hello @aleenaharoldpeter! Thanks for contributing to Old-School-Game – a curated collection of classic, brain-training games that boost memory, focus, creativity, and long-term brain health 🎯🧠. In today's world full of short-form distractions, this project helps rebuild deep focus and mental endurance through thoughtful gameplay. ✅ Important Things To Do:
✅ Your pull request has been submitted successfully, and a maintainer will review it soon. |
|
Caution Review failedThe pull request is closed. Summary by CodeRabbit
WalkthroughAdds a new client-side Bullet Math game page with timed arithmetic gameplay, difficulty levels, hints, scoring, and end-of-game overlay; adds CSS module styles for the game page; and registers a Bullet Math card on the game selection page. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Player
participant Page as BulletMath Page
participant Gen as EquationGenerator
participant Timer
participant UI as Overlay/UI
Player->>Page: Select difficulty & Click Start
Page->>Gen: generateEquation(difficulty)
Gen-->>Page: equation {a, op, b, answer, hint}
Page->>Timer: start(120s)
loop every second
Timer-->>Page: tick (timeLeft--)
alt timeLeft == 0
Page->>Timer: stop()
Page-->>UI: show Game Over overlay
end
end
Player->>Page: Submit answer (Enter)
alt valid && correct
Page->>Page: increment score & attempts
Page->>Gen: generateEquation(difficulty)
else wrong/invalid
Page-->>Player: mark input as wrong
end
Player->>UI: Play Again
UI->>Page: reset state & restart
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 8
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
public/BulletMath.pngis excluded by!**/*.png
📒 Files selected for processing (3)
src/app/game/bullet-math/page.module.css(1 hunks)src/app/game/bullet-math/page.tsx(1 hunks)src/app/game/page.tsx(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/app/game/page.tsx (1)
src/app/game/bullet-math/page.tsx (1)
BulletMath(114-267)
🪛 Biome (2.1.2)
src/app/game/bullet-math/page.tsx
[error] 224-226: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 248-259: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 259-261: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
| .input { | ||
| font-size: 28px; | ||
| font-weight: 600; | ||
| text-align: center; | ||
| padding: 10px 16px; | ||
| margin-left: 12px; | ||
| width: 120px; /* consistent width */ | ||
| border: 2px solid #aaa; | ||
| border-radius: 10px; | ||
| outline: none; | ||
| transition: border-color 0.2s, box-shadow 0.2s; | ||
| } | ||
|
|
||
| .input:focus { | ||
| border-color: #2563eb; /* nice blue highlight */ | ||
| box-shadow: 0 0 6px rgba(37, 99, 235, 0.5); | ||
| } | ||
|
|
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Deduplicate .input rules (keep one, add missing transition).
Two .input blocks + two :focus blocks create maintenance risk. Merge into one.
.input {
font-size: 28px;
font-weight: 600;
text-align: center;
padding: 10px 16px;
margin-left: 12px;
width: 120px; /* consistent width */
border: 2px solid #aaa;
border-radius: 10px;
outline: none;
- transition: border-color 0.2s, box-shadow 0.2s;
+ transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
-.input:focus {
- border-color: #2563eb; /* nice blue highlight */
- box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
-}
-
-/* duplicate starts */
-.input {
- font-size: 28px;
- font-weight: 600;
- text-align: center;
- padding: 10px 16px;
- margin-left: 12px;
- width: 120px;
- border: 2px solid #aaa;
- border-radius: 10px;
- outline: none;
- transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
-}
-
.input:focus {
border-color: #2563eb;
box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
}Also applies to: 119-136
🤖 Prompt for AI Agents
In src/app/game/bullet-math/page.module.css around lines 62 to 79 (and similarly
lines 119 to 136), there are duplicate .input and .input:focus rule blocks—merge
them into one .input block and one .input:focus block to avoid maintenance risk;
ensure the single .input includes font-size, font-weight, text-align, padding,
margin-left, width, border, border-radius, outline, and a transition that covers
both border-color and box-shadow, and ensure the single .input:focus sets
border-color and box-shadow as in the originals, then remove the duplicated rule
sets at lines 119-136.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@ajaynegi45 working on it |

🧮 New Game: Bullet Math
This PR adds a new brain game Bullet Math under
src/app/game/bullet-math/.✨ Features
🛠️ Fixes/Changes
src/app/game/page.tsxto include the newBullet Mathentry in the game selection.src/app/game/bullet-math/containing:page.tsx→ Game logicpage.module.css→ Styling✅ Checklist
This PR introduces a fresh math challenge game to the project. 🚀