Skip to content

Bad Rune Limit Not Enforced During Gameplay #236

@Skjesper

Description

@Skjesper

Priority: Medium
Component: RuneGenerator.ts, RuneHuntGame.tsx

Description
The RuneGenerator has a maxBadRunes setting (default 3) to limit Hans (bad runes) on screen, but this limit is only checked when creating initial runes. During gameplay, when runes are clicked and new ones spawn via ensureRunes(), the bad rune limit isn't consistently enforced, sometimes resulting in more than 3 bad runes on screen.
Steps to Reproduce

Start a game with default settings
Play for 10-15 seconds, clicking various runes
Observe that sometimes more than 3 Hans (bad runes) appear simultaneously
Check getBadRuneStats() in console - count exceeds max

Current Behavior

Initial runes respect the maxBadRunes limit in createInitialRunes()
ensureRunes() calls createNewRune() which checks bad rune count
However, timing issues or rapid successive calls can bypass the limit
No validation occurs after runes are created

Expected Behavior

Maximum of 3 bad runes (Hans) should be on screen at any time
When the limit is reached, only good runes should spawn
The system should validate and enforce the limit continuously

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions