you should define event listener like this at the very beginning of your program, so that they get set in the beginning before other code gets executed. Put the whole code block in the very beginning of your script and then it should work.
Also, I think you only need one onCollision listener for the man instead for all three spears. So something like this is everything you need I guess (you can also use
or operator instead of multiple
But then you need to put the logic where you check if
lives === 0 inside this block, you can put it in a function and call this function then.