1
0
mirror of https://github.com/osmarks/website synced 2025-09-01 18:27:55 +00:00

Patch achievement system

This commit is contained in:
2022-03-07 20:07:16 +00:00
parent bac2a75be6
commit ab801b8848
10 changed files with 166 additions and 71 deletions

View File

@@ -377,9 +377,9 @@ const mainLoop = () => {
if (hp <= 0) {
if ("points" in window) {
if (score >= 10) { points.unlockAchievement("emuwar10") }
points.updateMetric("foesVanquished", function(x) { return x + score }, 0)
points.updateMetric("deaths", function(x) { return x + 1 }, 0)
if (score >= 10) { points.then(points => points.unlockAchievement("emuwar10")) }
points.then(points => points.updateMetric("foesVanquished", function(x) { return x + score }, 0))
points.then(points => points.updateMetric("deaths", function(x) { return x + 1 }, 0))
}
clear(saybox)
say(saybox, gameOverMessage + " Press R to restart.")