Session 1: Particle effects system with click, building, and achievement visual feedback
This commit is contained in:
@@ -101,6 +101,7 @@ const Game = {
|
||||
|
||||
// Visual feedback
|
||||
UI.showFloatingText(event.clientX, event.clientY, `+${this.formatNumber(amount)}`);
|
||||
Particles.createClickParticles(event.clientX, event.clientY, 8);
|
||||
UI.update();
|
||||
},
|
||||
|
||||
@@ -180,6 +181,14 @@ const Game = {
|
||||
this.state.buildings[buildingId] = (this.state.buildings[buildingId] || 0) + 1;
|
||||
|
||||
UI.showNotification(`Bought ${BUILDINGS[buildingId].name}!`, 'success');
|
||||
|
||||
// Particle effect on building purchase
|
||||
const card = document.getElementById(`building-${buildingId}`);
|
||||
if (card) {
|
||||
const rect = card.getBoundingClientRect();
|
||||
Particles.createBuildingEffect(rect.left + rect.width / 2, rect.top + rect.height / 2);
|
||||
}
|
||||
|
||||
UI.update();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user