if statement in JavaScript game not working as desired to allow for collision detection
问题 I'm working through some basic steps in an HTML, CSS and JScript game to get very simple collision detection working between a CHARACTER and an ENEMY. I am looking for something that is simple enough to explain to children of age 8 - 11. If the character and the enemy collide then "game over". I have tried various things, but require some help with the code and an explanation of getComputedStyle method and what Properties it gets, for me to effectively create the main if statement. This is