Let's check stats and upgrade types we need to support. We can add upgrades like:
tripleBanana: shoots 3 bananas in a spread
shieldBoost: restores health & boosts max health
speedBoost: faster projectile speed / charge speed
bananaBomb: bigger splash radius / chain reaction
Let's update GameCanvas.tsx to:
- Make charge faster (
power = Math.min(1, power + dt * 2.8) instead of 1.5).
- Make hitboxes much larger and more forgiving (check distance to monkey center of mass
cy = m.y - 45 * m.scale with radius 55 * m.scale so hitting anywhere on the body or limbs or head registers!).
- Add upgrade state & methods to buy upgrades between waves.
- Support triple banana upgrade (
tripleBanana level > 0).
- Support shield repair / max health upgrade.
- Make monkeys slightly easier (slower patrol speed, longer throw intervals).
Let's edit src/game/GameCanvas.tsx.
Let's update src/App.tsx and src/game/GameCanvas.tsx to include maxHealth, credits, and upgrades. Let's check src/App.tsx initial stats.
Now let's update GameCanvas.tsx pushStats and state. Let's check GameCanvas.tsx pushStats implementation.
Now let's add buyUpgrade function to GameApi so the React shop UI can call it, and implement forgiving hitboxes (r = 58 * m.scale around cy = m.y - 45 * m.scale), faster charge speed, and shop phase between waves. Let's check GameCanvas.tsx spawn & wave logic.
Let's update GameCanvas.tsx to include buyUpgrade and resumeGame in apiRef.current. Let's check where apiRef.current = { start }; is set.
Now let's update throwBanana to handle triple upgrade (upgrades.triple > 0) and speed upgrade (upgrades.speed). Also let's update monkey hit detection to be extremely generous (torso + head + arms). Let's check throwBanana and banana collision loop in GameCanvas.tsx.
Now let's make the hit collision generous and reliable (any hit on the monkey's torso/head/limbs). Let's check the banana collision loop in GameCanvas.tsx.
Now let's check charging speed (power = Math.min(1, power + dt * 2.8) instead of 1.5) and wave completion transitioning to shop phase instead of direct auto-wave. Let's check wave completion in GameCanvas.tsx.
Now let's check wave completion and transition to shop phase. Let's check where phase = "wavebreak" or alive === 0 happens.
Let's make monkeys slightly less difficult (slower patrol speed and longer throw intervals) so the game is fun and accessible. Let's check makeMonkey in GameCanvas.tsx.
Now let's update src/App.tsx to handle the shop phase where players can view and purchase upgrades (Triple Banana Spread, Hazmat Suit Repair & Max Health, Velocity Booster, Big Bertha Radius), earn and spend credits, and resume the next wave. Let's inspect src/App.tsx.
Let's add the Upgrade Shop overlay in src/App.tsx when s.phase === "shop". Let's check where modals/overlays are rendered inside the canvas container.
Let's build the project to verify TypeScript compilation and bundling.
Successfully built the project with zero errors. Here are the enhancements made based on your feedback:
-
Massively Improved Hit Registration:
- Expanded the hitboxes from a tiny head center to a generous bounding zone covering the entire monkey (feet to head, torso, arms, and tail). Any contact with the monkey now instantly registers a mutation hit.
-
Much Faster Charging:
- Doubled the power charge rate (
power += dt * 2.8) so you can rapid-fire bananas instantly without waiting.
-
Easier Gameplay Balance:
- Reduced monkey patrol speeds and increased poop-throw intervals so the game is fun, fair, and accessible rather than overwhelming.
-
Abilities and Upgrade Shop:
- Between waves, you enter the Decontamination Terminal Shop where you earn credits by mutating and eliminating monkeys.
- Buy powerful upgrades:
- 🍌 Triple Banana Spread: Shoot 3 radioactive bananas in a spread at once.
- 🛡️ Hazmat Armor Upgrade: Increase max integrity and restore suit health.
- ⚡ Isotope Velocity: Increase banana throw speed and charge rate.
- 💥 Heavy Potassium Payload: Larger splash and chain mutation radius.
Files built: src/game/GameCanvas.tsx, src/App.tsx