var game = "play"; //This is the game variable
$("#Restart").click(function() { //Using the buttons
console.log("Restart Works");
gamerestart();
ctx.fill
});
function gamerestart(){
game = gamerestart;
ctx.fillStyle = '#00008b';
ctx.fillRect(0,0, canvas.width, canvas.height);
}
使用此方法使其他按钮工作但重启一个按钮不起作用?
答案 0 :(得分:0)
function gamerestart(){
game = gamerestart; //quotes?
ctx.fillStyle = '#00008b';
ctx.fillRect(0,0, canvas.width, canvas.height);
}
不应该是" gamerestart"?