1
0
mirror of https://github.com/osmarks/website synced 2025-09-03 03:07:56 +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

@@ -63,8 +63,8 @@ description: Lorem Ipsum (latin-like placeholder text), eternally. Somehow peopl
var count = 0
var unaddedCount = 0
var handlePoints = throttle(function() {
if (count >= 400) { points.unlockAchievement("lorem400") }
points.updateMetric("loremParagraphs", function(x) { return x + unaddedCount }, 0).then(function() { unaddedCount = 0 })
if (count >= 400) { points.then(p => p.unlockAchievement("lorem400")) }
points.then(p => p.updateMetric("loremParagraphs", function(x) { return x + unaddedCount }, 0).then(function() { unaddedCount = 0 }))
}, 300)
window.addEventListener("load", function() {