A way to do this is to use the same mechanism I used to display the 'game over' message:(tutorial.js:282)
if($("#player")[0].player.respawn()){ |
$("#player")[0]
allow you to access the DOM element (and not the jQuery object) with the id player
. Then we access the player object and call its respawn methode, what this methode does is to respawn the player if possible or return true if the player is dead and has no more life. It looks like you're new here. If you want to get involved, click one of these buttons!