Skip to content
Snippets Groups Projects
Commit 7df7bce8 authored by Ronnie Friman's avatar Ronnie Friman
Browse files

updated score logic

parent b0f4003e
No related branches found
No related tags found
2 merge requests!46Development to testing,!40Score replay
...@@ -51,16 +51,14 @@ export const TrackController = L.Class.extend({ ...@@ -51,16 +51,14 @@ export const TrackController = L.Class.extend({
if (tps && tps.length) this._draw.drawTrack(tps); if (tps && tps.length) this._draw.drawTrack(tps);
} }
for (let i = 0; i < this._scores.length; i++) { for (let i = 0; i < this._scores.length; i++) {
let newScore = 0;
let scores = this._scores[i]; let scores = this._scores[i];
for (let j = 0; j < scores.length; j++) { for (let j = 0; j < scores.length; j++) {
if ( if (scores[j].timestamp < time) {
scores[j].timestamp - 5000 < time && newScore = scores[j].score;
this._activeScores[i] < scores[j].score
) {
this._activeScores[i] = scores[j].score;
console.log(this._activeScores);
} }
} }
this._activeScores[i] = newScore;
} }
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment