已采纳回答 / 代小代
我的理解就是:window.requestAnimationFrame是w3c定义的标准啊,或者除了这四大浏览器之外的浏览器的内核,但是支持html5和requestAninationFrame方法,另外requestAnimFrame这个方法其实是setTimeout()和setIntervel()的加强版,Daisy姐说的很清楚了,这个方法里面封装了智能计算,不会像setTimeout那样存在过度累计,消耗浏览器资源,这个方法的封装也是让requestAnimFrame这个函数适应所有的浏览器,如果浏...
2016-06-22
已采纳回答 / 尐调_
var last_time= Date.now(); //定义每次执行gamloop()前的时间 ,初始值为当前时间T1var delta_time =0; //定义每次执行gamloop()耗费的时长,初始化值为 0 requestAnimationFrame(gamLoop); //循环执行gamloop()第一次循环 var now = Date.now();...
2016-06-22
已采纳回答 / java家洼
born方法中的代码写错了: this.x = ane.x[aneID];应该是:this.x[i]=ane.x[aneID]; this.y = canHeight - ane.len[aneID];应该是:this.y[i] = canHeight - ane.len[aneID];坐标x和y少写了[i].
2016-06-21
最新回答 / 幽灵家的秘密
语法是canvas.getContext(contextType,contextAttributes);(类型,属性)应该不支持缺省值。改成ctx1=can1.getContext("2d");
2016-05-30