问答详情
源自:4-1 一个实现动画的基础函数

这里使用requestanimationframe 试用么

如何用requestanimationframe 代替 setinterval 来写定时器

提问者:qq_暖心i_03660841 2018-03-13 17:57

个回答

  • qq_暖心i_03660841
    2018-03-30 17:15:57

    window.requestAnimationFrame('gameloop'); 这样写 不会调用自身

  • 慕码人2284628
    2018-03-15 16:44:03

    function gameloop(){

       window.requestAnimationFrame('gameloop');//会根据系统自己计算时间间隔

       render();

       update();

    }