Skip to content

1.0.5

Choose a tag to compare

@avcode-exe avcode-exe released this 04 Jun 05:48
· 135 commits to main since this release
v1.0.5: bug fixes, performance optimizations, and UX polish

Bug Fixes:
- Fix DEV mode Enter key not applying custom wave composition (game.js)
  Enter key handler now calls buildCustomFromCounts like the click handler does.
- Fix broken sell cooldown — was keyed per dead troop ID, making it non-functional.
  Changed to a single global cooldown timer (sellCooldownTimer) shared across all sells.
- Fix misleading monster count display — now shows alive + queued monsters instead
  of only unspawned monsters, giving the player accurate wave progress info.
- Fix wave transition animation timing — previously used fixed timestep decrements
  which drifted from real time. Now uses performance.now() for accurate animation.

Performance Optimizations:
- Share path segments across all monsters — each monster previously rebuilt identical
  segments[] arrays from waypoints. Now computed once at Game init and passed to
  every Monster constructor, eliminating redundant per-monster path construction.
- Zero-allocation chain lightning — replaced filter/sort/slice chain with a reusable
  _chainBuf array and in-place squared-distance sort (avoids Math.sqrt per comparison).
- In-place popup compaction — replaced filter() allocation with manual compaction loop,
  consistent with monster/troop/projectile cleanup patterns.

UX Polish:
- Hide inapplicable upgrade buttons — melee troops no longer show RNG button,
  non-lightning troops no longer show CHN button.
- Dynamic upgrade button width — buttons now stretch to fill available panel space
  instead of fixed 49px, adapting to visible button count (4 buttons ~48px, 3 ~65px, 2 ~98px).

Cleanup:
- Remove dead devWarningTimer code from Game constructor.