This is a really good spot.
That code certainly looks similar, but I have trouble imagining how else you would implement very basic collision detection between a projectile and a player object in a game of this nature.
That code certainly looks similar, but I have trouble imagining how else you would implement very basic collision detection between a projectile and a player object in a game of this nature.
More importantly, it is not just the collision check that is similar. Almost the entire sequence of operations is identical on a higher level:
1. enemyBullet/player collision check
2. same comment "// Player hit!" (this is how I found the code)
3. remove enemy bullet from array
4. decrement lives
5. update lives UI
6. (createParticle only exists in JS code)
7. if lives are <= 0, gameOver