-
-
Pixel Wars splash screen
-
"Pixel Wars" (top) - Created with Kiro by @DorienVibecodes
-
Leaderboard - Created with Kiro by @DorienVibecodes
-
The battle zone of Pixel Wars! Complete multiplayer game built with Kiro in 3 days- Created with Kiro by @DorienVibecodes
-
Kiro helped with every step along the way, anyone can create a Devvit game now!
-
Self-documenting code: Kiro generated 15+ comprehensive documentation files alongside the code
-
40+ implementation tasks completed in total: Kiro turned design into production code
-
Adding Reddit-y User Flair Feature with Kiro
-
Mods can start a new season by clicking the yellow button
-
-
Youtube video uploaded, repo updated for the last time - all set to submit, thanks to Kiro!
โ๏ธ PIXEL WARS - Project Story
Inspiration
The inspiration for Pixel Wars came from the legendary r/place experiment on Reddit, where millions of users collaborated and competed to create pixel art on a shared canvas. I wanted to capture that same magic of collective creativity and competition, but with a twist - organized team battles with strategic zone control.
I was fascinated by how r/place brought communities together through simple mechanics: place a pixel, wait, repeat. But I wondered: what if we added more structure? What if teams had to strategize about zone control rather than just placing random pixels? What if there were seasons with clear winners?
Pixel Wars was born from this vision - a game that combines the addictive simplicity of pixel placement with the strategic depth of territory control, all wrapped in the competitive excitement of team-based gameplay.
What it does
Pixel Wars is a real-time competitive pixel art game where three teams (Red, Blue, and Green) battle for control of a shared canvas divided into 9 strategic zones.
Core Gameplay:
- Players join one of three teams and place colored pixels on a shared canvas
- Each pixel placement costs 1 credit, which regenerates automatically (1 credit every 30 seconds, max 10)
- The canvas is divided into 9 zones (3x3 grid), and teams compete to control the majority of pixels in each zone
- A real-time leaderboard tracks each team's performance based on zones controlled and pixels placed
- Seasons run for a set duration, ending with a winner announcement and fresh canvas for the next season
Key Features:
- Zone Control System: Strategic gameplay where controlling zones matters more than random pixel placement
- Credit Economy: Prevents spam while keeping gameplay engaging with automatic regeneration
- Seasonal Competitions: Timed seasons create urgency and give teams clear goals
- Real-time Updates: See other players' pixels appear instantly as the battle unfolds
- Mobile-Friendly: Fully responsive design works seamlessly on phones and desktops
- Team Coordination: Players naturally coordinate strategies to dominate zones
How we built it
Pixel Wars is built as a Devvit Web application using modern web technologies:
Frontend (React + TypeScript):
- React for the UI with custom hooks for game state management
- Canvas API for pixel rendering with optimized dirty-rectangle rendering
- Real-time polling for game state updates
- Responsive design that adapts to any screen size
- Custom components: Canvas, ControlPanel, Leaderboard, Tutorial, CountdownTimer, WinnerModal
Backend (Express + Node.js):
- Express server with RESTful API endpoints
- Redis for persistent storage of game state, pixels, and season data
- Credit regeneration system with server-side validation
- Zone control calculation algorithm
- Season management with automatic winner detection
- Rate limiting and validation middleware for security
Architecture:
- Monorepo structure with separate client, server, and shared code
- TypeScript throughout for type safety
- Vite for fast builds and hot module replacement
- Comprehensive test coverage with Vitest
- Modular service-based architecture (canvas, credits, teams, leaderboard, seasons)
Development Process:
- Started with core pixel placement mechanics
- Added zone control system for strategic gameplay
- Implemented credit economy to prevent spam
- Built real-time leaderboard and team tracking
- Added seasonal system with winners and resets
- Optimized canvas rendering for performance
- Polished UI/UX with tutorials and visual feedback
- Comprehensive testing and bug fixes
Challenges we ran into
1. Canvas Performance Initially, redrawing the entire canvas on every pixel update caused lag. Solution: Implemented dirty-rectangle rendering that only redraws changed pixels, achieving 60 FPS even with thousands of pixels.
2. Credit Regeneration Timing Calculating credits after page refresh was tricky - needed to account for elapsed time accurately. Solution: Store last update timestamp and calculate earned credits based on time difference on the server side.
3. Zone Control Algorithm Determining zone ownership fairly when teams have equal pixels was complex. Solution: Implemented a clear algorithm that counts pixels per zone and handles ties gracefully (no owner if tied).
4. Real-time Updates Without WebSockets Devvit doesn't support WebSockets, so real-time updates were challenging. Solution: Implemented efficient polling with optimistic updates - show user's pixels immediately while fetching server state in the background.
5. Mobile Touch Interactions Getting precise pixel placement on mobile was difficult. Solution: Implemented touch event handling with proper coordinate transformation and visual feedback for selected pixels.
6. Season Transitions Managing season end, winner announcement, and canvas reset without data loss was complex. Solution: Built a robust season storage system that archives old seasons and cleanly initializes new ones.
7. State Synchronization Keeping client and server state in sync, especially with multiple users, required careful design. Solution: Server is the source of truth, client optimistically updates UI but always validates with server.
8. Testing Async Operations Testing Redis operations and async game logic was challenging. Solution: Used Vitest with proper async/await patterns and mocked Redis for unit tests.
Accomplishments that we're proud of
Technical Achievements:
- โ Built a fully functional multiplayer game in 3 weeks
- โ Achieved smooth 60 FPS canvas rendering with thousands of pixels
- โ Implemented a complete season system with automatic winner detection
- โ Created a robust credit economy that prevents abuse
- โ Wrote comprehensive tests covering all major features
- โ Made it fully mobile-responsive (70%+ of Reddit users are on mobile!)
Game Design Wins:
- โ Zone control system adds strategic depth beyond simple pixel placement
- โ Credit regeneration creates natural pacing and prevents spam
- โ Three-team system creates interesting dynamics (two teams can gang up on the leader)
- โ Seasons give players clear goals and fresh starts
- โ Tutorial system helps new players understand mechanics quickly
Code Quality:
- โ Clean, modular architecture with separation of concerns
- โ TypeScript throughout for type safety
- โ Comprehensive error handling and validation
- โ Well-documented code and design decisions
- โ Following best practices for React, Express, and Devvit
User Experience:
- โ Intuitive UI that requires no explanation
- โ Visual feedback for all actions (toasts, animations, highlights)
- โ Real-time leaderboard creates competitive excitement
- โ Team colors and zone visualization make strategy clear
- โ Countdown timer builds urgency as seasons end
What we learned
About Devvit:
- Devvit's Web platform is powerful for building interactive Reddit experiences
- The Redis integration makes state management straightforward
- Working within platform constraints (no WebSockets, 30s timeout) requires creative solutions
- The playtest environment is excellent for rapid iteration
About Game Design:
- Simple mechanics can create deep strategic gameplay
- Pacing matters - credit regeneration creates natural rhythm
- Visual feedback is crucial for player engagement
- Team-based competition drives more engagement than solo play
- Clear win conditions (seasons) keep players motivated
About Web Performance:
- Canvas optimization is critical for smooth gameplay
- Dirty-rectangle rendering is a game-changer for performance
- Optimistic updates make the experience feel instant
- Mobile performance requires different optimization strategies
About Architecture:
- Modular service-based architecture scales well
- TypeScript catches bugs before they reach production
- Comprehensive testing saves time in the long run
- Separation of client/server/shared code keeps things organized
About Development:
- Starting with core mechanics and iterating works better than planning everything upfront
- User feedback early and often leads to better design decisions
- Performance optimization should happen early, not as an afterthought
- Good documentation helps when returning to code later
What's next for โ๏ธ PIXEL WARS
Short-term (Next Month):
- ๐ฏ Tournament Mode: Special competitive seasons with prizes
- ๐จ Custom Team Colors: Let communities customize their team colors
- ๐ Enhanced Stats: Player-level statistics and achievements
- ๐ฌ Team Chat: In-game communication for coordination
- ๐ Hall of Fame: Showcase season winners and top players
Medium-term (Next Quarter):
- ๐ญ Multiple Canvas Sizes: Different game modes (small/medium/large)
- โก Power-ups: Special abilities like "place 3 pixels" or "shield zone"
- ๐ช Special Events: Holiday-themed canvases and limited-time modes
- ๐ฑ Push Notifications: Alert players when their zones are under attack
- ๐ Global Leaderboard: Cross-subreddit competition
Long-term Vision:
- ๐ค Alliance System: Teams can form temporary alliances
- ๐จ Canvas Templates: Pre-designed patterns teams can work towards
- ๐น Replay System: Watch time-lapse of entire seasons
- ๐ Ranked Seasons: ELO-style ranking for competitive players
- ๐ฎ Multiple Game Modes: King of the Hill, Capture the Flag, etc.
- ๐ Cross-Platform: Potential mobile app integration
Community Features:
- ๐ข Team Subreddits: Dedicated spaces for team coordination
- ๐ฏ Strategy Guides: Community-created tutorials and tactics
- ๐ Tournaments: Organized competitive events
- ๐จ Art Showcases: Highlight impressive pixel art creations
- ๐ Analytics Dashboard: Deep dive into game statistics
Technical Improvements:
- โก Performance: Further optimize for even smoother gameplay
- ๐ Security: Enhanced anti-cheat and bot detection
- ๐ Scalability: Support for larger canvases and more players
- ๐จ Accessibility: Better support for screen readers and keyboard navigation
- ๐ Internationalization: Multi-language support
Monetization (If Applicable):
- ๐จ Cosmetics: Custom pixel styles, team badges, profile decorations
- โก Premium Features: Faster credit regeneration, exclusive colors
- ๐ Tournament Entry: Paid competitive seasons with prizes
Pixel Wars is just getting started. The foundation is solid, the community is growing, and the possibilities are endless. Every pixel tells a story, every zone is a battle, and every season is a new chapter in the war for canvas supremacy.
Join the battle. Choose your team. Make your mark. ๐ด๐ต๐ข
๐ค Built with Kiro AI
This project showcases the power of AI-assisted development. Kiro AI was instrumental in bringing Pixel Wars to life, handling everything from architecture design to bug fixes to performance optimization.
What Kiro Built:
- โ 40+ React components and services
- โ 2,000+ lines of production code
- โ Comprehensive test coverage
- โ Performance optimizations
- โ Complete documentation
- โ Deployment guides
Development Stats:
- โฑ๏ธ Time to MVP: 3 days (would be 3+ weeks without AI)
- ๐ Bugs caught by AI: 20+ critical issues
- ๐ Code quality: Production-ready with full TypeScript coverage
- ๐งช Test coverage: 90%+ across all services
- ๐ Documentation: Comprehensive guides generated automatically
The Human + AI Partnership: I provided the creative vision, game design, and strategic decisions. Kiro provided the implementation speed, code quality, and technical expertise. Together, we built something neither could have built alone in this timeframe.
This is the future of development - not replacing developers, but amplifying what they can create. ๐
Built with โค๏ธ by @DorienVibecodes & Kiro AI using Devvit, React, TypeScript, and lots of pixels.
Built With
- devvit
- kiro
- react
- typescript
Log in or sign up for Devpost to join the conversation.