:: Start There are 10 seconds left. <% $(function() { var timeLeft = parseInt($('.time-left').text()); function tick() { if (--timeLeft === 0) { story.show('World End'); } else { $('.time-left').text(timeLeft); } _.delay(tick, 1000); } /* Start ticking. */ _.delay(tick, 1000); }); %> :: World End The world ended.