html5贪吃蛇游戏使用63行代码完美实现

2020-04-21 07:37:29易采站长站整理

a = Math.ceil(Math.random()*50);
cxt.fillStyle = “#000000”;//内部填充颜色
cxt.strokeStyle = “#000000”;//边框颜色
cxt.fillRect(a*8, a*8, 8, 8);//绘制矩形
}
// 随机放置食物
rand_frog();
</script>
</body>
</html>