As a beginner in React, I decided to challenge myself by recreating a classic game like 'space invader'. It seemed like a fun and simple project for someone at my skill level.
My goal is to have a spaceship at the bottom of the screen that can shoot laser beams at the aliens above!
However, I'm struggling with using useRef() to manipulate the position of the spaceship. I've been attempting to access the 'left' or 'right' properties of the associated style class, but I've hit a roadblock.
Oddly enough, I can modify the background color or width of the spaceship, but I can't seem to adjust the 'left' or 'right' properties to move it around.
Check out my humble attempt at the project here:
https://codesandbox.io/s/condescending-bose-ehn4f?file=/src/index.js