Day 108 of Learning MERN Stack

์ž‘์„ฑ์ž

์นดํ…Œ๊ณ ๋ฆฌ:

โ† ํ”ผ๋“œ๋กœ
DEV Community ยท Ali Hamza ยท 2026-07-08 ๊ฐœ๋ฐœ(SW)
Cover image for Day 108 of Learning MERN Stack

Ali Hamza

Hello Dev Community! ๐Ÿ‘‹

It is officially Day 108 of my software engineering marathon! Today marks Day 2 of building my top-down Runner Game, and I shifted the environment from a static graphic frame directly into an active, high-velocity simulation engine! ๐Ÿƒโ€โ™‚๏ธ๐Ÿ’จ๐Ÿ”ฅ

When building infinite scrollers, creating and deleting DOM elements continuously causes massive garbage collection spikes. Today, I bypassed this bottleneck by engineering a high-performance Object Recycler Algorithm alongside custom session clocks!

๐Ÿง  Breaking Down the Day 108 Engine Mechanics

As compiled live inside my system sandbox across “Screenshot (243).jpg”, “Screenshot (244).png”, and “Screenshot (245).png”, today’s engineering sprint locked in major functional layers:

1. The Obstacle Recycler Pattern (reverseHurdlesOnHittingLimit)

  • Instead of spawning new hurdle nodes, the engine tracks their boundary offsets dynamically.
  • The moment a hurdle asset passes the player and clears the screen edge boundary (e.g., hurdleNo1 > 705), it triggers a quick reset condition (“Screenshot (244).png”):

javascript
  if (hurdleNo1 > 705) {
      hurdleNo1 = -120; // Loops obstacle straight back to the top area
      hurdleElement1.classList.add('hid-line');
      // SetTimeout gracefully handles hidden visibility transition lifecycles
  }

Enter fullscreen mode Exit fullscreen mode

์›๋ฌธ์—์„œ ๊ณ„์† โ†—

์ถ”์ถœ ๋ณธ๋ฌธ ยท ์ถœ์ฒ˜: dev.to ยท https://dev.to/ali_hamza_589ec7b3eb6688d/day-108-of-learning-mern-stack-4mh2

์ฝ”๋ฉ˜ํŠธ

๋‹ต๊ธ€ ๋‚จ๊ธฐ๊ธฐ

์ด๋ฉ”์ผ ์ฃผ์†Œ๋Š” ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ํ•„๋“œ๋Š” *๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค