var can1;var can2;var ctx1;var ctx2;var lastTime;var deltaTime;document.body.onload = game;function game(){ init(); gameloop();}function init(){ can1 = document.getElementById("canvas1"); ctx1 = can1.getContext('2d'); can2 = document.getElementById("canvas2"); ctx2 = can2.getContext();}function gameloop(){ window.requestAnimFrame(gameloop);}
1 回答
KXFT
TA贡献113条经验 获得超58个赞
两个都改成getContext("2d")
can1 = document.getElementById("canvas1");
ctx1 = can1.getContext("2d");
can2 = document.getElementById("canvas2");
ctx2 = can2.getContext("2d");
添加回答
举报
0/150
提交
取消