Code to Play gamifies your coding experience by unlocking fun mini-games as you write code. Every 100 lines unlocks 5 plays across all games. Track your progress, compete against your high scores, and take fun breaks without leaving VS Code.
Coding sessions can be intense. Code to Play gamifies your workflow by rewarding your progress with classic mini-games. Write meaningful code, unlock plays, and enjoy guilt-free breaks—all within VS Code. Perfect for:
- Staying motivated during long coding sessions
- Taking mental breaks without context switching
- Tracking progress with automatic code line counting
- Having fun while being productive
- Reducing risk of burnout and stress
Play classic games with a coding twist:
- Debug Snake - Catch bugs (ladybugs) and grow your debugging skills
- Whack-a-Bug - Click bugs before they escape in this fast-paced game
- Automatically counts meaningful lines of code
- Excludes comments, blank lines, and trivial changes
- Supports 13+ programming languages. Click to check supported files
- File type tracking
- Real-time progress updates
- Write code to unlock plays
- Default: 100 lines = 5 plays.
- Global play counter shared across all games
- Visual progress in status bar
- Unlock notifications to celebrate milestones
- Track your best performances
- Local storage - your data stays private
- Per-game high score tracking
- Reset individual high scores anytime
- Compete against yourself!
- Beautiful stats dashboard
- Total lines written
- Total plays across all games
- Per-game breakdowns
- Export your data as JSON
- Zero telemetry - no data collection
- All data stored locally
- No internet required
- No external API calls
- Your code stays private
- Open VS Code Or any VS Code dependent IDE (e.g. cursor).
- Go to the Extensions view (
Ctrl+Shift+XorCmd+Shift+Xon Mac). - Search for "React Next.js Smart Snippets".
- Click Install.
- Reload the IDE if prompted.
Open any supported code file (.ts, .js, .py, .java, etc.) and start writing code.
Check the status bar (bottom of VS Code):
- Locked:
45/100 lines- Keep coding! - Unlocked:
5 plays- Ready to play!
- Click the 🎮 Code to Play icon in the Activity Bar (left sidebar)
- Choose a game from the list
- Click to play and enjoy your break!
Code to Play uses a smart algorithm to count only meaningful code:
✅ Counted as Code:
- Function and class declarations
- Variable assignments and declarations
- Control flow statements (if, for, while, etc.)
- Method calls and expressions
- Import/export statements
❌ Not Counted:
- Comments (single-line
//and multi-line/* */) - JSDoc comments (
/** */) - Blank lines
- Lines with only braces
{} - Whitespace-only lines
Language Support: JavaScript, TypeScript, Python, Java, C, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, and more!
Write Code → Track Lines → Reach Threshold → Unlock Games
↓
Play → Use 1 Play → Repeat
↓
No Plays Left → Lock → Write More Code
All data is stored locally using VS Code's storage API:
Stored Data:
- High scores per game
- Total plays per game
- Total lines written
- Current unlock status
- Plays remaining
Privacy:
- No data sent to external servers
- No telemetry or tracking
- Everything stays on your machine
- Uninstall removes all data
Q: How do I unlock games?
A: Write code! Default is 100 meaningful lines = 5 plays. Watch the status bar for progress.
Q: What languages are supported?
A: JavaScript, TypeScript, Python, Java, C/C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, and more. Click to check supported files
Q: Can I adjust the unlock threshold?
A: Yes! Settings → Code to Play → Adjust "Lines to Unlock" and "Plays Per Unlock"
Q: Do games work offline?
A: Yes! Everything runs locally. No internet required.
Q: Does this slow down VS Code?
A: No! Code to Play uses minimal resources and only tracks when you're actively coding.
Q: Why aren't my lines being counted?
A: Check that your file type is in the tracked extensions list. Also ensure "Count Meaningful Lines Only" isn't excluding your code style.
- 🎮 More games (Tetris, Space Invaders, Pong)
- 🎚️ Difficulty levels for existing games
- 🏅 Achievements system
- 📊 More detailed statistics
- 🎨 Custom themes
- 🔊 Sound effects (toggleable)
- 📅 Daily challenges
- Multiplayer leaderboards (opt-in)
- Team competitions
- Custom game creation API
- Integration with GitHub contributions
- Online games.
Want to suggest a feature? Open an issue!
No major issues currently reported.
Report a bug: GitHub Issues
This extension is licensed under the Apache License.
Fonts:
- Press Start 2P by CodeMan38 - SIL Open Font License
- Orbitron by Matt McInerney - SIL Open Font License
Special thanks to the font creators for making these available!
-
Email: okenwavictor003@gmai.com
-
Support Me: Buy me a coffee on Patreon https://patreon.com/morse_code
Made with ❤️ by developers, for developers
GitHub • Report Issue • Request Feature
Happy coding and gaming! 🎮💻





