Skip to content

Fix worm targeting/kill semantics, increase Panel C rain density, and resize HUD timers - #60

Merged
TeacherEvan merged 5 commits into
mainfrom
copilot/fix-worms-symbols-issues
Feb 23, 2026
Merged

TeacherEvan merged 5 commits into
mainfrom
copilot/fix-worms-symbols-issues

Conversation

Copilot AI commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

This issue combined multiple gameplay regressions: worm stealing behavior was inconsistent (including stealing non-visible symbols), purple worm interaction rules were inverted, splat FX were not reliably visible, and HUD/rain tuning needed adjustment. This PR applies focused fixes in the worm behavior/event paths and small config/UI updates.

  • Worm targeting and stealing rules

    • Restricted steal candidates to user-visible symbols (.revealed-symbol) for active steal attempts.
    • Updated rush targeting path to use revealed symbols for non-purple worms, preventing steals against unrevealed content.
    • Touched:
      • src/scripts/worm-movement-navigation.js
      • src/scripts/worm-system.behavior.js
  • Purple worm interaction semantics

    • Direct click on purple worm now clones only (does not kill original).
    • Matching symbol click from Panel C now kills purple worm directly (same event-driven path as rain kills).
    • Touched:
      • src/scripts/worm-system.interactions.js
      • src/scripts/worm-system.events.js
      • src/scripts/worm-system.spawn.js (log text alignment)
  • Worm death FX visibility

    • Made splat rendering deterministic by adding explicit glyph content and z-index override at creation time.
    • Touched:
      • src/scripts/worm-system.effects.js
  • HUD and rain tuning

    • Reduced score/time HUD typography by ~30%.
    • Doubled symbol rain density in Panel C by increasing wave count and pool size.
    • Touched:
      • src/styles/css/score-timer.css
      • src/scripts/symbol-rain.config.js
  • Focused behavior coverage

    • Added a targeted Playwright assertion for purple worm click behavior (clone-on-click).
    • Touched:
      • tests/worm-behavior.spec.js
// Purple worm click now clones without killing the clicked worm
proto.handlePurpleWormClick = function(worm) {
  if (!worm.active) return;
  this.clonePurpleWorm(worm);
};

// Purple worm is killed only by matching Panel C symbol click
if (worm.isPurple && normalizedWormSymbol === normalizedClicked) {
  this.explodeWorm(worm, true);
  return;
}

UI snapshot

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1200/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1200/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate,AutoDeElevate,RenderD bin/node s js s git (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1200/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1200/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate,AutoDeElevate,RenderD de/node/bin/node (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1200/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1200/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate,AutoDeElevate,RenderD h eractions.js srcgit (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Feb 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
math-master-html Ready Ready Preview, Comment Feb 22, 2026 1:17pm

…sizing

Co-authored-by: TeacherEvan <189960447+TeacherEvan@users.noreply.github.com>
Co-authored-by: TeacherEvan <189960447+TeacherEvan@users.noreply.github.com>
Co-authored-by: TeacherEvan <189960447+TeacherEvan@users.noreply.github.com>
Co-authored-by: TeacherEvan <189960447+TeacherEvan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bugs related to worm behavior and visual effects Fix worm targeting/kill semantics, increase Panel C rain density, and resize HUD timers Feb 22, 2026
Copilot AI requested a review from TeacherEvan February 22, 2026 13:20

@TeacherEvan TeacherEvan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the best you can do?

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

Is this the best you can do?

No — I can improve this further. I focused on minimal, low-risk fixes first; if you’re still seeing issues, I’ll tighten the behavior in a follow-up pass immediately. Please point me to the exact remaining failure (e.g., worms still stealing hidden symbols, purple kill flow, splat visibility, or rain/timer tuning) and I’ll patch it next in one focused commit.

@TeacherEvan
TeacherEvan requested a review from Copilot February 23, 2026 02:36
@TeacherEvan
TeacherEvan marked this pull request as ready for review February 23, 2026 02:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses multiple worm behavior regressions by restricting worm stealing to user-visible symbols, fixing purple worm interaction semantics, improving death FX visibility, and tuning HUD/rain density. The changes shift worm targeting from hidden symbols to revealed symbols system-wide, simplify purple worm kill mechanics (direct click clones, rain symbol kills), and enhance visual feedback.

Changes:

  • Restricted all worm steal attempts to .revealed-symbol class instead of .hidden-symbol, preventing steals against unrevealed content
  • Changed purple worm direct click to clone-only (no kill), with Panel C rain symbol match as the sole kill path
  • Made splat FX deterministic by adding explicit glyph content and z-index in JS
  • Reduced HUD typography ~30% and doubled Panel C symbol rain density

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/scripts/worm-system.behavior.js Changed steal logic to filter revealed-symbol only for both purple and normal worms
src/scripts/worm-movement-navigation.js Purple worms still search all symbols during rush but non-purple use revealed only
src/scripts/worm-system.interactions.js Removed explode-and-clone logic, purple click now clone-only
src/scripts/worm-system.events.js Removed purple-to-green mechanic, rain symbol click now directly explodes purple worms
src/scripts/worm-system.effects.js Added explicit textContent and z-index to slime splat for visibility
src/scripts/worm-system.spawn.js Updated console log text to reflect new purple worm behavior
src/scripts/symbol-rain.config.js Doubled symbolsPerWave (7→14) and poolSize (30→60) for increased rain density
src/styles/css/score-timer.css Reduced HUD label (12px→8px) and value (28px→20px, 22px→15px mobile) font sizes
tests/worm-behavior.spec.js Added test asserting purple worm click clones instead of killing

proto.createSlimeSplat = function(x, y) {
const splat = document.createElement("div");
splat.className = "slime-splat";
splat.textContent = "🫟";

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS now uses ::before pseudo-element to add "🫟" glyph (line 118-122 in worm-effects.core.css), but the JS explicitly sets textContent to "🫟" as well. This creates a duplicate emoji - one from textContent and one from ::before. Either remove the ::before rule or remove the textContent assignment here to avoid displaying two splat emojis.

Suggested change
splat.textContent = "🫟";

Copilot uses AI. Check for mistakes.
Comment on lines +44 to 60
// PURPLE WORM LOGIC: can only steal symbols currently visible to the user
let availableSymbols;
if (worm.canStealBlue && worm.isPurple) {
// First, try to get red (hidden) symbols only
const redSymbols = allAvailableSymbols.filter((el) =>
el.classList.contains("hidden-symbol"),
availableSymbols = allAvailableSymbols.filter((el) =>
el.classList.contains("revealed-symbol"),
);
console.log(
`🟣 PURPLE WORM - ${availableSymbols.length} revealed symbols available`,
);

if (redSymbols.length > 0) {
// Red symbols available - purple worm steals red symbols like normal
availableSymbols = redSymbols;
console.log(
`🟣 PURPLE WORM - ${redSymbols.length} red symbols available (preferring red)`,
);
} else {
// NO red symbols - now purple worm can steal blue symbols!
const blueSymbols = allAvailableSymbols.filter((el) =>
el.classList.contains("revealed-symbol"),
);
availableSymbols = blueSymbols;
console.log(
`🟣 PURPLE WORM - NO red symbols! Stealing blue symbols (${blueSymbols.length} available)`,
);
}
} else {
// Normal worm - only steal red (hidden) symbols
// All non-purple steal attempts are restricted to currently revealed symbols
availableSymbols = allAvailableSymbols.filter((el) =>
el.classList.contains("hidden-symbol"),
el.classList.contains("revealed-symbol"),
);
console.log(
`🐛 Normal worm - ${availableSymbols.length} red symbols available`,
`🐛 Normal worm - ${availableSymbols.length} revealed symbols available`,
);

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment and code logic now contradict the PR description. The PR states "purple worm moves slower, steals visible symbols" but lines 47-52 only filter for revealed-symbol class, which is identical to the non-purple worm logic on lines 55-60. This means purple worms and normal worms now have the same symbol targeting behavior, eliminating any special purple worm steal mechanics. If purple worms are supposed to have unique targeting (like the old red-symbol preference), this logic needs to be different from the normal worm path.

Copilot uses AI. Check for mistakes.
Comment on lines 164 to 172
if (worm.isPurple && worm.canStealBlue) {
const redSymbols = allAvailableSymbols.filter((el) =>
el.classList.contains("hidden-symbol"),
);
if (redSymbols.length > 0) return redSymbols;

return allAvailableSymbols.filter((el) =>
el.classList.contains("revealed-symbol"),
);
}

return allAvailableSymbols.filter((el) =>
el.classList.contains("hidden-symbol"),
el.classList.contains("revealed-symbol"),
);

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _getAvailableSymbolsForWorm method now returns identical symbol sets for both purple and non-purple worms (both filter for revealed-symbol class). This duplicates the filtering logic and makes the purple worm conditional branch pointless. Consider consolidating this into a single return statement since both paths are now identical.

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +54
const symbolsToSearch = worm.isPurple
? this.getCachedAllSymbols()
: this.getCachedRevealedSymbols();

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purple worms can still search getCachedAllSymbols() during rush targeting (lines 52-54), but the actual steal logic in worm-system.behavior.js now restricts them to revealed-symbol only. This creates an inconsistency: purple worms will rush toward hidden symbols they detect via getCachedAllSymbols(), but then fail to steal them when they arrive because stealSymbol() filters for revealed-symbol only. This wastes movement and creates confusing behavior. Either purple worms should search only revealed symbols in both places, or they should be allowed to steal all symbols in both places.

Suggested change
const symbolsToSearch = worm.isPurple
? this.getCachedAllSymbols()
: this.getCachedRevealedSymbols();
// Purple worms should only rush toward symbols they can actually steal.
// Steal logic is restricted to revealed symbols, so we target only revealed.
const symbolsToSearch = this.getCachedRevealedSymbols();

Copilot uses AI. Check for mistakes.
const purpleWorm = page.locator(".worm-container.purple-worm").first();
await purpleWorm.click({ force: true });

await page.waitForTimeout(400);

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test uses page.waitForTimeout(400) for synchronization, which is a brittle timing-based wait. If worm cloning animation or processing takes longer than 400ms (for example, on slower CI machines), the test could flake. Consider using waitForFunction with a condition that checks the actual purple worm count has increased, or adding a deterministic event that signals when cloning is complete.

Suggested change
await page.waitForTimeout(400);
await page.waitForFunction(
(previousCount) =>
window.wormSystem?.worms.filter((w) => w.active && w.isPurple).length >
previousCount,
beforeClickCount,
);

Copilot uses AI. Check for mistakes.
Comment on lines 30 to +40
@@ -37,7 +37,7 @@
// Layout
columnWidth: 50,
gridCellSize: 100,
poolSize: 30,
poolSize: 60,

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doubling both symbolsPerWave (7→14) and poolSize (30→60) quadruples the total potential symbol pool while only doubling the spawning rate. This could lead to memory/DOM bloat if the animation cleanup doesn't keep pace, especially on lower-end devices. Consider monitoring DOM node count in the performance budget or implementing a more aggressive pool recycling strategy to prevent accumulation of inactive symbol elements.

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +66
font-size: 8px;
letter-spacing: 2px;
opacity: 0.9;
}

.hud-value {
font-size: 28px;
font-size: 20px;

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reducing HUD font size by ~30% (12px→8px for labels, 28px→20px for values) may create accessibility issues for users with visual impairments or on smaller screens. Consider testing against WCAG 2.1 minimum font size guidelines (typically 14px for body text). If these are decorative/secondary HUD elements, ensure critical game state is still visible at a comfortable size.

Copilot uses AI. Check for mistakes.
@TeacherEvan
TeacherEvan merged commit e8adff9 into main Feb 23, 2026
8 checks passed
@TeacherEvan
TeacherEvan deleted the copilot/fix-worms-symbols-issues branch February 23, 2026 03:00

This branch was successfully deployed

1 active deployment
Preview 2eb0a4f4 Deployed Feb 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants