June 2015
Beginner
354 pages
8h 23m
English
Carry out the following steps:
audiogame.js JavaScript file.$(audiogame.melody).bind('ended', onMelodyEnded); // show game over scene on melody ended.
function onMelodyEnded() {
console.log('song ended');
alert ('success percent: ' + audiogame.totalSuccessCount / audiogame.totalDotsCount * 100 + '%');
}
})(jQuery);We just listened to the ended event of the audio element and handled it with a handler function. ...
Read now
Unlock full access