Skip to content

Add Pokémon Identification Game#3

Merged
LFDave merged 3 commits intomainfrom
copilot/add-pokemon-identification-game
Jan 10, 2026
Merged

Add Pokémon Identification Game#3
LFDave merged 3 commits intomainfrom
copilot/add-pokemon-identification-game

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

Pokémon Identification Game - Complete Implementation ✅

Overview

Implemented a complete, kid-friendly Pokémon identification game as specified in the PRD. The game is a lightweight browser application that runs entirely on GitHub Pages with no build step required.

Implementation Checklist:

  • Create data directory and pokemon.json with initial 151 Pokemon dataset
  • Create pokemon-game.html as the main game entry point
  • Implement game HTML structure with all required screens (Home, Game, Medals, Settings)
  • Implement CSS with dark mode, accessibility features, and responsive design
  • Implement core game JavaScript logic:
    • State management and localStorage persistence
    • Pokemon data loading and decoy selection
    • Game loop (display image, 3 options, feedback, scoring)
    • Coin system and streak tracking
    • Medal/achievement system with unlock notifications
    • Screen navigation (Home, Game, Medals, Settings)
    • Settings (sound toggle, reduced motion, reset progress)
    • Keyboard accessibility support
  • Add legal disclaimers and credits in footer
  • Update main README.md with Pokemon game information
  • Manual testing on desktop and mobile viewport
  • Take screenshots of the implemented game
  • Fix layout issues based on user feedback

Recent Updates:

  • Removed "Back to Home" button from game screen to prevent accidental presses when clicking "Next Pokémon"
  • Fixed layout shift issue: "Next Pokémon" button now always visible but disabled until answer is given, eliminating page height changes

Features Delivered:

Core Gameplay

  • 151 Generation 1 Pokémon from Bulbasaur to Mew
  • 3-option multiple choice per question (1 correct, 2 decoys)
  • Instant feedback with visual animations
  • +1 coin per correct answer
  • Streak tracking (current & best)
  • Avoids recent repeats (last 10 Pokémon)
  • Loading states with skeleton screens

Medal System (6 Achievements)

  • 🪙 5 Coins! - Earn 5 coins
  • 💰 10 Coins! - Earn 10 coins
  • 🏆 20 Coins! - Earn 20 coins
  • 🔥 On a Roll - Get 3 correct in a row
  • 🗺️ Explorer - Answer 10 questions
  • Pikachu Spotted! - Correctly identify Pikachu

Accessibility & UX

  • Dark mode with high contrast (WCAG-friendly)
  • Keyboard navigation (Tab, Enter, Space, 1-3 numbers, Escape)
  • Focus indicators (3px gold outline)
  • ARIA live regions for screen reader feedback
  • Touch-friendly buttons (minimum 48px height)
  • Respects prefers-reduced-motion
  • Responsive design (mobile & desktop)
  • Mystery Pokémon alt text before answer (no spoilers)
  • Stable layout - no page jumps when buttons change state

Settings & Data

  • 🔊 Sound Effects toggle (ready for future enhancement)
  • 🎬 Reduced Motion toggle
  • 🔄 Reset Progress with confirmation
  • 💾 localStorage persistence (no login required)
  • 🔒 Privacy-first (no tracking, no analytics)

Legal & Credits

  • Proper trademark disclaimers for Nintendo/Game Freak/The Pokémon Company
  • Fan-made, non-commercial, educational disclaimer
  • Image credits to Pokémon Database CDN
  • Privacy notice in footer

Technical Implementation:

  • Single HTML file (pokemon-game.html) - 1,027 lines
  • Inline CSS & JavaScript - no build step
  • Data file (data/pokemon.json) - 151 Pokémon entries
  • Works offline after first load
  • GitHub Pages ready - open file directly in browser

Screenshots:

Home Screen (Desktop)
Home Screen

Game Screen - Before Answer
Game Screen Before
Note: Next button is disabled and visible, preventing layout shifts

Game Screen - After Answer
Game Screen After
Note: Next button becomes enabled, no Back to Home button to accidentally press

Medals Screen
Medals

Settings Screen
Settings

Mobile View
Mobile

Security Notes:

  • No user text input (only button clicks)
  • All data from controlled JSON file
  • No external API calls except for images
  • No eval() or unsafe DOM manipulation
  • CodeQL found no security issues

Testing Performed:

✅ All screens navigate correctly
✅ Game loop works (select answer → feedback → next)
✅ Coins increment on correct answers
✅ Streak resets on wrong answers
✅ Medal system checks work
✅ Settings toggles persist
✅ Keyboard navigation functional
✅ Mobile responsive layout works
✅ Footer disclaimers present
✅ No layout shift when Next button state changes
✅ No accidental Back button presses

Files Changed:

  • Added: pokemon-game.html (main game)
  • Added: data/pokemon.json (151 Pokémon dataset)
  • Modified: README.md (added game documentation)

Ready for deployment to GitHub Pages! 🎮⚡

Original prompt

This section details on the original issue you should resolve

<issue_title>Pokemon Identification Game</issue_title>
<issue_description>## PRD — Pokémon Identification Game (Web, GitHub Pages)

1) Summary

A lightweight, kid-friendly browser game (ages 8–12) where the player sees a Pokémon image and must pick the correct name from 3 options. Each correct answer grants 1 coin. The game runs as static HTML/CSS/JavaScript and is hosted on GitHub Pages.

2) Goals

  • Fun + fast gameplay loop: image → choose name → instant feedback → next.
  • Works everywhere: modern browsers + mobile (touch-first).
  • Accessible: strong contrast, readable type, keyboard support, WCAG-friendly.
  • Progression: coins + medal achievements, saved locally (no login).

3) Non-goals

  • Multiplayer, accounts, server-side leaderboards
  • Real-money monetization or ads
  • Complex Pokémon stats/moves/types

4) Target audience & design principles (Kids 8–12)

  • Big tap targets (thumb-friendly), minimal reading required.
  • Positive feedback (celebratory animations, encouraging messages).
  • Low frustration: clear “Correct / Try again” and quick next question.
  • Safe by default: no chat, no user-generated content, no tracking.

5) Platform & hosting

  • Deployment: GitHub Pages.
  • Tech: Vanilla HTML + CSS + JS (no build step required).
  • State: localStorage only (coins, medals, simple stats).

6) Content & assets (Important)

Images: Use Pokémon artwork/sprites sourced from PokémonDB’s image CDN (e.g., img.pokemondb.net). PokémonDB states their written content/layout shouldn’t be reused, but notes official artwork/sprites are used under a “Fair Use Policy” and may be used. ([Pokémon Database][1])
Pokémon itself remains copyrighted/trademarked; include a clear disclaimer and keep the project non-commercial/educational. Pokémon’s official legal pages emphasize content is copyrighted unless stated otherwise. ([Pokémon][2])

Implementation approach (recommended):

  • Ship a local data/pokemon.json file containing Pokémon id + name + imageUrl.
  • Load that JSON at runtime and display images via their URLs.

7) Core gameplay loop

Round structure

  1. Game selects a target Pokémon.

  2. UI shows its image + 3 name buttons (1 correct, 2 decoys).

  3. User taps/clicks one option.

  4. Immediate feedback:

    • Correct: +1 coin, increase streak, celebrate
    • Wrong: streak resets, show correct answer, gentle prompt
  5. “Next” (or auto-advance after a short delay, configurable).

Rules

  • Exactly 3 options per question.

  • Only 1 correct option.

  • Coins: +1 per correct answer.

  • Stats tracked:

    • coins
    • totalAnswered
    • totalCorrect
    • currentStreak
    • bestStreak
    • seenPokemonIds (optional, to reduce repeats)

8) Medals / achievements

Medals unlock automatically when criteria are met. Show a celebratory unlock modal/toast once per medal.

Medal ideas (initial set)

Implement medals as a data-driven list:

Medal ID Name Unlock condition
coins_5 “5 Coins!” coins >= 5
coins_10 “10 Coins!” coins >= 10
coins_20 “20 Coins!” coins >= 20
streak_3 “On a Roll” currentStreak >= 3
answered_10 “Explorer” totalAnswered >= 10
pikachu “Pikachu Spotted!” Correctly identify Pokémon with id/name Pikachu at least once

Medal screen

  • Grid of medal cards (locked/unlocked states)
  • Each card: icon/badge, title, short description
  • Locked medals show silhouette + hint (kid-friendly)

9) UX & UI requirements

Visual style

  • Dark mode by default.
  • Bright, crafted accent colors with high contrast and clear button states.
  • Avoid relying on color alone (use icons/text for correct/incorrect).
  • Use CSS variables for theming (easy adjustments).

Screens (minimum)

  1. Home / Start

    • Title, “Play” button
    • Optional: “Medals”, “Settings”
  2. Game

    • Top bar: coins, streak, medals shortcut
    • Main: Pokémon image (center), 3 big answer buttons
    • Feedback area (aria-live)
  3. Medals

    • Medal grid, progress summary
  4. Settings

    • Toggle: Sound on/off (optional)
    • Toggle: Reduced motion (respects system preference)
    • Button: Reset progress (with confirmation)

Interaction & feedback

  • Buttons disable immediately after an answer to prevent double taps.
  • Correct answer animation: subtle confetti / sparkle (respect `prefers-reduce...

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: LFDave <36726874+LFDave@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Pokémon identification game for kids Add Pokémon Identification Game Jan 10, 2026
Copilot AI requested a review from LFDave January 10, 2026 09:47
@LFDave
Copy link
Owner

LFDave commented Jan 10, 2026

@copilot where can I test the html page?

@LFDave
Copy link
Owner

LFDave commented Jan 10, 2026

image tasks: a) look at the screenshot b) Remove the "back to home" button as it is unintentionally pressed instead of "next pokemon". c) Make sure the page height is not changed when the "next pokemon" button is inserted. Rather the space should be be already allocated. It can be with a greyed out button that becomes active when the answer is given.

@copilot

Copy link
Owner

@LFDave LFDave left a comment

Choose a reason for hiding this comment

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

see my comments in the pull request

…t shift

Co-authored-by: LFDave <36726874+LFDave@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 10, 2026

image tasks: a) look at the screenshot

...

Fixed in commit 479eccc:

a) ✅ Reviewed the screenshot showing the layout issue
b) ✅ Removed the "Back to Home" button from the game screen
c) ✅ Changed "Next Pokémon" button to be always visible but disabled initially - it becomes enabled after answering, preventing layout shifts

Before Answer:
Before

After Answer:
After

The button now maintains consistent spacing and there's no risk of accidentally pressing a Back button.

@copilot where can I test the html page?

You can test the HTML page by:

  1. Directly opening the file: Download pokemon-game.html and open it in your browser
  2. GitHub Pages: Once merged, it will be available at your GitHub Pages URL
  3. Local server: Run python3 -m http.server in the repo directory and open http://localhost:8000/pokemon-game.html

The game works entirely client-side with no build step required!

Copilot AI requested a review from LFDave January 10, 2026 13:50
@LFDave LFDave marked this pull request as ready for review January 10, 2026 13:55
@LFDave LFDave merged commit 9490559 into main Jan 10, 2026
1 check passed
@LFDave LFDave deleted the copilot/add-pokemon-identification-game branch January 10, 2026 13:55
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.

Pokemon Identification Game

2 participants