//设置棋盘背景图片
var logo=new Image();
logo.src="image/logo1.png";
logo.onload =function(){
context.drawImage(logo,0,0,450,450);
drawChessBoard();
}
var drawChessBoard=function(){
//通过for循环画出棋盘间距14,共14条线,每格30像素
for(var i=0;i<15;i++){
//横线
//纵线
}
var logo=new Image();
logo.src="image/logo1.png";
logo.onload =function(){
context.drawImage(logo,0,0,450,450);
drawChessBoard();
}
var drawChessBoard=function(){
//通过for循环画出棋盘间距14,共14条线,每格30像素
for(var i=0;i<15;i++){
//横线
//纵线
}
CanV.onclick=function(ev){
//获取点击位置
var x=Math.floor(ev.offsetX/30);
var y=Math.floor(ev.offsetY/30);
if(arrS.indexOf(x+"-"+y)===-1){
oneStep(x,y,me);
me =!me;
arrS.push(x+"-"+y);
}else{
CanV.style.disabled="disabled"
}
//获取点击位置
var x=Math.floor(ev.offsetX/30);
var y=Math.floor(ev.offsetY/30);
if(arrS.indexOf(x+"-"+y)===-1){
oneStep(x,y,me);
me =!me;
arrS.push(x+"-"+y);
}else{
CanV.style.disabled="disabled"
}