30 lines
545 B
Markdown
30 lines
545 B
Markdown
# Power.js — tick() (satır 36)
|
||
|
||
[← Power.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
```javascript
|
||
function tick(c)
|
||
{
|
||
c.scheduleScript(20, function(c)
|
||
{
|
||
var s = c.getSubject().getStates();
|
||
|
||
if (s.getString("cps_active") !== "1") return;
|
||
|
||
var time = parseInt(s.getString("cps_time")) - 1;
|
||
|
||
s.setString("cps_time", "" + time);
|
||
|
||
updateUI(c);
|
||
|
||
if (time <= 0)
|
||
{
|
||
finish(c);
|
||
return;
|
||
}
|
||
|
||
tick(c);
|
||
});
|
||
}
|
||
```
|