DEV Community

Cover image for Day 103 of Learning MERN Stack
Ali Hamza
Ali Hamza

Posted on

Day 103 of Learning MERN Stack

Hello Dev Community! 👋

It is officially Day 103 of my engineering journey! Pushing deeper into my 5-day arcade framework run, today I successfully shifted my Flying Car Game (JS Version) from static visual elements into an active, controllable interface! 🏎️⚡

When handling frequent position overrides on high-speed assets, changing structural style elements via inline strings causes layout recalculation overhead. Today, I solved this by leveraging native CSS custom variables and state-driven DOM event interception!


🧠 Breaking Down the Day 103 Component Setup & Movement Engine

As showcased inside my local codebase workspace across "Screenshot (232).png" and "Screenshot (233).png", today's engineering sprint locked down major technical layers:

1. Granular DOM Domination & Component Mapping

  • Targeted every distinct element entity using crisp query hooks inside app.js ("Screenshot (232).png").
  • Grouped background line grids (.lines, .line1) and mapped vehicle array matrices according to color signatures (.aqua, .blue, .purple, .red, .yellow, .formula).
  • Initialized specific dimensional offsets for coin collections using a strict numerical layout reference:

javascript
  const positionArrayOfCoin = [30, 170, 290, 410, 520];
Enter fullscreen mode Exit fullscreen mode

Top comments (0)