From 143bd68f5b5a4fb1de7f6fd60b7709d04f5a4f30 Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Wed, 27 May 2026 14:34:56 -0700 Subject: [PATCH] Position pokeball burst effect on actual Pokemon element instead of hardcoded coordinates --- game.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/game.js b/game.js index dd5af65..600ee4e 100644 --- a/game.js +++ b/game.js @@ -1338,10 +1338,12 @@ class Game { catchScreen.appendChild(ball); setTimeout(() => { + const pokeRect = pokemonEl.getBoundingClientRect(); + const screenRect = catchScreen.getBoundingClientRect(); const burst = document.createElement('div'); burst.className = 'pokeball-burst'; - burst.style.left = '50%'; - burst.style.top = '25%'; + burst.style.left = (pokeRect.left - screenRect.left + pokeRect.width / 2) + 'px'; + burst.style.top = (pokeRect.top - screenRect.top + pokeRect.height / 2) + 'px'; catchScreen.appendChild(burst); ball.remove();