我的代码和老师一样的,这里却出错了
var can1;
var can2;
var ctx1;
var ctx2;
document.body.onload=game;
function game()
{
init();
}
function init()
{
//获得canvas context
can1=document.getElementById("canvas1");//fishes,dust,UI,circle
ctx1=can1.getContext();
can2=document.getElementById("canvas2");//background,ane ,fruits
ctx2=can2.getContext();
}