Why the previously mentioned solution doesn’t work at all

Owen Abbott
Oct 16, 2020

This was an illuminating afternoon.

I used .getClientRects() to handle the hit detection on the bunkers, and it worked beautifully on the first bunker I tested it on. I had to change around my code for detecting collisions a little bit, which meant it no longer worked on the invaders. So I then attempted to refactor the detection on the space invaders, and it did not work well at all.

In order to figure out the blank space between invaders using clientRects, it’s looking like I have to use a lot of the same math that I thought I could refactor away. I can either push forward and redo a lot more than I thought I’d have to, or I can roll back to a previous version.

I’m glad I’ve been actively committing changes.

--

--