Course: CS50's Introduction to Game Development
Assignment: Pokémon
Engine / Language: LÖVE2D (Lua)
This repository contains my implementation of the Pokémon assignment from CS50’s Introduction to Game Development.
🎮 The project recreates a simplified Pokémon battle system inspired by the original Game Boy titles — featuring turn-based combat, health mechanics, and level-up progression.
In this version, I implemented an enhanced Level-Up Stats Menu, improving the feedback loop and making the experience more engaging and visually informative.
-
✔️ Level-Up Stat Menu
Added a detailed Level-Up Menu that appears right after the "Level Up" dialogue following a victorious battle. -
✔️ Stat Breakdown Display
The menu shows each stat’s progress in the format:X + Y = Zwhere:
X→ Initial stat valueY→ Increment gained on level-upZ→ Resulting final value
-
✔️ Cursor Toggle Feature
Enhanced the Selection class to accept a boolean argument that toggles the visibility of the menu cursor, ensuring a clean display without unnecessary navigation during the stat summary. -
✔️ Integration with State System
Extended the TakeTurnState (particularly within the:victory()function) to:- Detect level-up events.
- Push both the
BattleMessageStateand the newMenuto the StateStack in sequence.
-
✔️ Level-Up Logic Handling
Utilized the returned stat increments fromPokemon:levelUp()to populate the custom menu dynamically.
-
Install LÖVE2D:
Download and install from LÖVE2D. -
Clone this repository:
git clone https://github.com/huzaifa-gamedev/cs50-pokemon.git cd cs50-pokemon -
Run the Game:
love .
- Arrow Keys (↑ ↓ ← →) — Navigate menus.
- Enter/Return — Select an option or confirm.
- Escape — Exit menu or quit game.
-
Menu Customization:
ModifiedSelectionandMenuclasses to support cursor toggling and text-only displays. -
State Management:
Integrated the new menu into the StateStack workflow, ensuring proper transitions betweenBattleMessageState,Menu, and post-battle states. -
Level-Up Feedback:
Designed the stats display to be clear, immediate, and consistent with Pokémon’s traditional visual style. -
Testing:
Verified functionality by simulating multiple battles, ensuring accurate stat calculation and menu sequencing.
- Original skeleton code & assets: CS50's Introduction to Game Development (Harvard). Licensed under CC BY-NC-SA 4.0.
- This implementation: © 2025 Muhammad Huzaifa Karim. Licensed under the MIT License.
For more details, see ATTRIBUTION.md.
Muhammad Huzaifa Karim
GitHub Profile
For feedback, suggestions, or collaboration opportunities, feel free to reach out via GitHub.
© 2025 Muhammad Huzaifa Karim. All rights reserved.
