var appleTimer = game.time.create(true);appleTimer.loop(1000, function() {})我怎么能让loop循环时间不是固定的1000,而是随着时间慢慢变快了呢
1 回答

GCT1015
TA贡献1827条经验 获得超4个赞
可以用定时递归,例如:
var timeout = 1000;
function test() {
setTimeout(function() { // do some thing if (要继续定时执行) { test(); } else { // 结束了 } }, timeout); timeout = timeout <= 200 ? 200 : timeout - 50;
}
// 让它跑起来
test();
添加回答
举报
0/150
提交
取消