var appleTimer = game.time.create(true);appleTimer.loop(1000, function() {})我怎么能让loop循环时间不是固定的1000,而是随着时间慢慢变快了呢
可以用定时递归,例如: var timeout = 1000;function test() { setTimeout(function() { // do some thing if (要继续定时执行) { test(); } else { // 结束了 } }, timeout); timeout = timeout <= 200 ? 200 : timeout - 50; } // 让它跑起来test();
可以用定时递归,例如:
var timeout = 1000;
function test() {
}
// 让它跑起来
test();