MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / updateTime

Function updateTime

assets/js/block_ninja.js:281–292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

279 const initialOptions = { rechargeTime, units };
280
281 const updateTime = () => {
282 const now = state.game.time;
283 // Reset time remaining if time goes backwards.
284 if (now < lastTime) {
285 timeRemaining = 0;
286 } else {
287 // update...
288 timeRemaining -= now-lastTime;
289 if (timeRemaining < 0) timeRemaining = 0;
290 }
291 lastTime = now;
292 };
293
294 const canUse = () => {
295 updateTime();

Callers 1

canUseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected