June 2015
Beginner
354 pages
8h 23m
English
We will store some game play statistics and use them to adjust the melody volume. We will continue with our JavaScript file:
var audiogame = {
totalSuccessCount: 0,
// storing the success count of last 5 results.
successCount: 5,
// existing code goes here.
};hitOnLine function:// check if hit a music note dot for(var i in audiogame.dots) { if (lineNo === audiogame.dots[i].line && Math.abs(audiogame.dots[i].distance) < 20) { // remove the hit dot from the dots array audiogame.dots.splice(i, 1); ...Read now
Unlock full access