diff options
Diffstat (limited to 'race/cars/car0.js')
-rw-r--r-- | race/cars/car0.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/race/cars/car0.js b/race/cars/car0.js index ddfe8c5..ad1c227 100644 --- a/race/cars/car0.js +++ b/race/cars/car0.js @@ -54,6 +54,7 @@ startHooks.push(() => { Sound.crash() document.getElementById("car0").style.left = car0startx + "px"; document.getElementById("car0").style.top = car0starty + "px"; + require('electron').ipcRenderer.send('addstats', { catalog: "ingame", key: "walls", add: 1 }); Array.from(document.getElementById('oil').children).forEach((item) => { spreadOil(item); }) @@ -96,6 +97,7 @@ startHooks.push(() => { } else { Sound.last() } + require('electron').ipcRenderer.send('addstats', { catalog: "ingame", key: "laps", add: 1 }); document.getElementById('laps-car0').innerText = (document.getElementById('laps-car0').innerText.split("/")[0] - 1 + 2).toString(); if (location.search === "?sp") { if ((document.getElementById('laps-car0').innerText.split("/")[0] - 1 + 1) > (document.getElementById('laps-car1').innerText.split("/")[0] - 1 + 1)) { @@ -106,6 +108,7 @@ startHooks.push(() => { } } else { info("CarManager:car0", "Car won the game"); + require('electron').ipcRenderer.send('addstats', { catalog: "results", key: "wins", add: 1 }); if (location.search === "?sp") { scenar("won1", "sad"); } @@ -156,6 +159,7 @@ startHooks.push(() => { scenar("wall1", "happy"); } Sound.crash(); + require('electron').ipcRenderer.send('addstats', { catalog: "ingame", key: "walls", add: 1 }); document.getElementById("car0").style.left = car0startx + "px"; document.getElementById("car0").style.top = car0starty + "px"; Array.from(document.getElementById('oil').children).forEach((item) => { |