我有一个 JavaScript 文件,我正在为使用 Phaser 框架的游戏处理,并且我有多个计时器,唯一的事情是我不确定如何让其中一个计时器在第一个计时器开始运行后一点点运行开始了。由于框架 JS 文件,我无法提供实际工作的代码,但我可以提供我正在使用的代码。
//This is my first timer, it works how I like
timer1 = game.time.events.loop(1500, addAnimals, this);
//I want this one to start a little bit later than the other one
timer2 = game.time.events.loop(1500, increaseScore, this);
我不确定如何解决这个问题,如果有人可以帮助我,那就太好了!