igt-vue
igt-vue copied to clipboard
Create Counter tool
The Counter
should take an interval in seconds. After running update(delta)
on it, it can be used in 3 ways:
const c = new Counter(30, this.save)
c.update(delta)
const c = new Counter(30)
c.onComplete.subscribe(this.save)
const c = new Counter(30)
if(c.update(delta)) {
this.save()
}
This Counter should replace the save interval, achievement check and special events
Also add a boolean that determines if excess delta should carry over or be discarded