0
How the enmy detected
2 Answers
+ 3
It doesn't work properly -- have you posted a comment on his code with what you're seeing / error message?
How is the enemy detected (I think you mean shots hitting your ship)? By checking if each bullet intersects with ANY document element. While the "death" event is dispatched to all elements that are hit (including the enemy) only your ship responds to it.
Here's a copy of the source with comments:
https://code.sololearn.com/WBMYvnfDpyS3/?ref=app
To hit the enemy with its own bullet:
22 var start = height;
$("#enemy").on("death", function(){
end();
});
0
this game not work.. properly