Each module is self-contained but communicates through shared game state, allowing for easy expansion and maintenance.
Challenges Faced
Challenge 1: State Management Complexity
Problem: Managing game state with 35+ upgrades, 6 pet types, skills, inventory, daily rewards, and events became overwhelming.
Solution: Implemented a centralized gameState object with clear structure, and created separate manager classes for complex systems. Used JSON serialization for save/load functionality.
Challenge 2: Real-time Season Detection
Problem: Needed to detect the current season based on actual calendar dates and apply bonuses accordingly.
Solution: Created a syncRealTimeSeason() function that calculates the season from the current month and updates bonuses dynamically. The function runs periodically to handle season changes.
Challenge 3: Pet Leveling System
Problem: Initially, pet leveling wasn't working correctly—levels weren't incrementing, and evolution wasn't triggering properly.
Solution: Redesigned the leveling system with proper EXP tracking per stage, implemented evolution thresholds, and added visual feedback. Fixed scope issues with event listeners for pet actions.
Challenge 4: Daily Reward Calendar
Problem: Creating an interactive calendar that shows the current month, highlights today's date, and tracks claimed rewards.
Solution: Built a dynamic calendar generator that calculates the month layout, handles day-of-week offsets, and integrates with the daily reward system. Used date keys to track claims across sessions.
Challenge 5: Performance with Many Upgrades
Problem: With 35+ upgrade tiers, rendering and calculations could become slow.
Solution: Implemented efficient rendering that only updates changed elements, used requestAnimationFrame for smooth animations, and optimized the game loop to update in batches rather than every frame.
Challenge 6: Save/Load System
Problem: Ensuring all game state (including nested objects like pets, skills, and inventory) saves and loads correctly.
Solution: Created a comprehensive save system that serializes the entire game state, including manager states. Added error handling for corrupted saves and version checking for future compatibility.
Mathematical Formulas
The game uses several mathematical formulas for progression:
Prestige Star Dust Calculation: $$ \text{Star Dust} = \left\lfloor \sqrt{\frac{\text{Total Vibes}}{1,000,000}} \right\rfloor $$
Passive Income Per Second: $$ \text{VPS} = \sum_{i=1}^{n} (\text{Upgrade}_i \times \text{Production}_i) \times \text{Passive Multiplier} \times (1 + \text{Pet Bonus}) $$
Combo Multiplier: $$ \text{Combo} = \min(1.0 + 0.1 \times \text{Consecutive Clicks}, 10.0) $$
Upgrade Cost Scaling: $$ \text{New Cost} = \text{Base Cost} \times 1.15^{\text{Purchase Count}} $$
Log in or sign up for Devpost to join the conversation.