Skip to content

[WIP] Enhance gameplay with bonuses and special effects#52

Draft
Claude wants to merge 5 commits into
mainfrom
claude/improve-gameplay-experience
Draft

[WIP] Enhance gameplay with bonuses and special effects#52
Claude wants to merge 5 commits into
mainfrom
claude/improve-gameplay-experience

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 17, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Improve gameplay</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

*Describe the solution you'd like
Enhance gameplay with bonuses, combos and chain reaction. Use the graphics and tiles in the asset folder to improve the experience and add special effects.

Describe alternatives you've considered
AI assisted gameplay for the first 7 donating players and all players until 7 players donate

Image Image Image

Additional context
Add any other context or screenshots about the feature request here.
</issue_description>

<agent_instructions>Improve the graphics and gameplay with chain reactions and animations. Special items and a store </agent_instructions>

Comments on the Issue (you are @claude[agent] in this section)

@Claude Claude AI linked an issue Apr 17, 2026 that may be closed by this pull request
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 17, 2026

Deploy Preview for gulfnexus ready!

Name Link
🔨 Latest commit 666402c
🔍 Latest deploy log https://app.netlify.com/projects/gulfnexus/deploys/69e3c298eaeb1e0008a0e2bd
😎 Deploy Preview https://deploy-preview-52--gulfnexus.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 93
Accessibility: 100
Best Practices: 92
SEO: 82
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Claude AI and others added 3 commits April 17, 2026 22:01
…tore

- Replace emoji gems with high-quality star graphics from IMG_* assets
- Add combo multiplier system (up to 10x) that increases with chain reactions
- Implement particle explosion effects for matched gems
- Add animated combo banners (2x, 5x MEGA, 8x SUPER)
- Create in-game store with power-up purchases (bomb, lightning, rainbow)
- Implement coin currency system (earn coins from combos and level-ups)
- Add visual feedback with pulsing animations and glow effects
- Improve cell styling with gradients and hover effects
- Add comprehensive CSS animations for explosions and particles

Agent-Logs-Url: https://github.com/NicholaiMadias/gamifiedlearning.github.io/sessions/fe6719f2-2b16-430d-83cd-e116b603634a

Co-authored-by: NicholaiMadias <73684379+NicholaiMadias@users.noreply.github.com>
- Implement bomb power-up (clears 3x3 area)
- Implement lightning power-up (clears entire row and column)
- Implement rainbow power-up (clears all gems of selected type)
- Add power-up activation buttons with visual feedback
- Add pulsing glow animation for active power-ups
- Power-ups award bonus points (15 per gem) and coins
- Add instructional banner when power-up is activated
- Integrate special gem effects with chain reaction system

Agent-Logs-Url: https://github.com/NicholaiMadias/gamifiedlearning.github.io/sessions/fe6719f2-2b16-430d-83cd-e116b603634a

Co-authored-by: NicholaiMadias <73684379+NicholaiMadias@users.noreply.github.com>
- Add crosshair cursor when power-up is active for better UX
- Store gameplay mechanics memory for future reference
- Store graphics/assets system memory
- Polish power-up activation visual feedback

Agent-Logs-Url: https://github.com/NicholaiMadias/gamifiedlearning.github.io/sessions/fe6719f2-2b16-430d-83cd-e116b603634a

Co-authored-by: NicholaiMadias <73684379+NicholaiMadias@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This WIP PR enhances the Match Maker minigame by adding combo-based scoring, purchasable/usable power-ups (bomb/lightning/rainbow), and updated visuals/animations using the image assets in the repo.

Changes:

  • Add special-gem effect logic (bomb 3×3, lightning row+col, rainbow clear-by-type) to the game state module.
  • Extend the UI with combo tracking, coin economy, a store panel, and power-up activation/consumption.
  • Update rendering/CSS to use image-based gems plus explosion + particle effects and new HUD elements (combo/coins).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
matchMakerState.js Introduces SPECIAL_GEM_TYPES and applySpecialGem() to clear cells according to power-up behavior.
match-maker-ui.js Implements combo scoring, coins/store, power-up usage flow, and match animations/particles.
index.html Adds combo/coins UI, power-up buttons, store markup, and styling/animations for the new effects.

Comment thread match-maker-ui.js
Comment on lines +233 to 241
// Animate matched cells
animateMatches(matches);

grid = clearMatches(grid, matches);
grid = applyGravity(grid);
renderGrid();

// chain reactions
setTimeout(resolveMatches, CHAIN_REACTION_DELAY_MS);
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

animateMatches() adds explosion/particle effects, but resolveMatches() immediately calls renderGrid(), whose container.innerHTML = '' removes the animated nodes (and any particles) before the effects can be seen. To make the special effects visible, delay clearing/applying gravity + re-render until after the animation duration, or render into separate layers (cells vs. effects) so effects aren’t wiped by innerHTML.

Copilot uses AI. Check for mistakes.
Comment thread match-maker-ui.js
Comment on lines +276 to +298
function createParticles(cell) {
const rect = cell.getBoundingClientRect();
const container = document.getElementById('match-grid');
const containerRect = container.getBoundingClientRect();

for (let i = 0; i < 8; i++) {
const particle = document.createElement('div');
particle.className = 'particle';

const angle = (Math.PI * 2 * i) / 8;
const distance = 30 + Math.random() * 20;
const dx = Math.cos(angle) * distance;
const dy = Math.sin(angle) * distance;

particle.style.left = (rect.left - containerRect.left + rect.width / 2) + 'px';
particle.style.top = (rect.top - containerRect.top + rect.height / 2) + 'px';
particle.style.setProperty('--dx', dx + 'px');
particle.style.setProperty('--dy', dy + 'px');

container.appendChild(particle);

setTimeout(() => particle.remove(), 600);
}
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

createParticles creates 8 DOM nodes per cleared cell and runs every chain reaction step; a large match (or repeated cascades) can generate hundreds of elements and timeouts quickly, causing jank on low-end devices. Consider capping particles per resolution, basing count on match size, or pooling/reusing particle elements instead of creating/removing many nodes each time.

Copilot uses AI. Check for mistakes.
Comment thread index.html
Comment on lines +470 to +487
<div class="store-item" id="store-bomb" onclick="purchasePowerUp('bomb', 30)">
<div class="store-item-icon">💣</div>
<div class="store-item-name">Bomb</div>
<div class="store-item-cost">30 coins</div>
<div class="store-item-owned">Owned: <span id="store-bomb-count">0</span></div>
</div>
<div class="store-item" id="store-lightning" onclick="purchasePowerUp('lightning', 50)">
<div class="store-item-icon">⚡</div>
<div class="store-item-name">Lightning</div>
<div class="store-item-cost">50 coins</div>
<div class="store-item-owned">Owned: <span id="store-lightning-count">0</span></div>
</div>
<div class="store-item" id="store-rainbow" onclick="purchasePowerUp('rainbow', 80)">
<div class="store-item-icon">🌈</div>
<div class="store-item-name">Rainbow</div>
<div class="store-item-cost">80 coins</div>
<div class="store-item-owned">Owned: <span id="store-rainbow-count">0</span></div>
</div>
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

The store items are clickable <div>s with onclick, which are not keyboard-focusable and won’t be operable by keyboard/screen readers by default. Consider using <button> elements, or add role="button", tabindex="0", and key handlers (Enter/Space) so the store is accessible.

Suggested change
<div class="store-item" id="store-bomb" onclick="purchasePowerUp('bomb', 30)">
<div class="store-item-icon">💣</div>
<div class="store-item-name">Bomb</div>
<div class="store-item-cost">30 coins</div>
<div class="store-item-owned">Owned: <span id="store-bomb-count">0</span></div>
</div>
<div class="store-item" id="store-lightning" onclick="purchasePowerUp('lightning', 50)">
<div class="store-item-icon"></div>
<div class="store-item-name">Lightning</div>
<div class="store-item-cost">50 coins</div>
<div class="store-item-owned">Owned: <span id="store-lightning-count">0</span></div>
</div>
<div class="store-item" id="store-rainbow" onclick="purchasePowerUp('rainbow', 80)">
<div class="store-item-icon">🌈</div>
<div class="store-item-name">Rainbow</div>
<div class="store-item-cost">80 coins</div>
<div class="store-item-owned">Owned: <span id="store-rainbow-count">0</span></div>
</div>
<button type="button" class="store-item" id="store-bomb" onclick="purchasePowerUp('bomb', 30)">
<div class="store-item-icon">💣</div>
<div class="store-item-name">Bomb</div>
<div class="store-item-cost">30 coins</div>
<div class="store-item-owned">Owned: <span id="store-bomb-count">0</span></div>
</button>
<button type="button" class="store-item" id="store-lightning" onclick="purchasePowerUp('lightning', 50)">
<div class="store-item-icon"></div>
<div class="store-item-name">Lightning</div>
<div class="store-item-cost">50 coins</div>
<div class="store-item-owned">Owned: <span id="store-lightning-count">0</span></div>
</button>
<button type="button" class="store-item" id="store-rainbow" onclick="purchasePowerUp('rainbow', 80)">
<div class="store-item-icon">🌈</div>
<div class="store-item-name">Rainbow</div>
<div class="store-item-cost">80 coins</div>
<div class="store-item-owned">Owned: <span id="store-rainbow-count">0</span></div>
</button>

Copilot uses AI. Check for mistakes.
Comment thread match-maker-ui.js
Comment on lines 30 to +44
export function initMatchMaker(dbRef, userRef) {
db = dbRef;
user = userRef;
score = 0;
moves = 20;
level = 1;
combo = 0;
activePowerUp = null;
selected = null;
grid = createInitialGrid();
renderGrid();
updateStats();
updateStoreDisplay();
updatePowerUpButtons();
}
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

initMatchMaker resets score/moves/level but does not reset coins or powerUps, even though coins is documented as “Starting coins”. Hitting Restart will carry over store state unexpectedly and can desync the initial UI values. Consider resetting coins/powerUps here (or update the comment/UI if persistence is intended).

Copilot uses AI. Check for mistakes.
Comment thread match-maker-ui.js
Comment on lines 238 to 242
renderGrid();

// chain reactions
setTimeout(resolveMatches, CHAIN_REACTION_DELAY_MS);
}
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

There’s no cancellation/guard for the recursive setTimeout(resolveMatches, ...) chain reaction. If the player hits Restart while a timeout is pending, the old callback can fire against the new game state and start multiple concurrent resolve loops. Track the timeout id (and/or a generation token) and clear/ignore stale callbacks in initMatchMaker/restart.

Copilot uses AI. Check for mistakes.
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.

Improve gameplay

4 participants