AcwSpringbootke3--2,游戏界面上
1创建一个类实现调用就会动画60帧给他
2requestAnimationFrame(step)
3js里面in调用下标,of值
3什么时候import要加{},只有vue里面defult,每一个文件只有一个defult,就像java每一个文件只有一个public
4import {ref} from 'vue'从vue里面引入
5
让parent指向div
6import {ref,onMounted} from 'vue'这个onMounted就是挂载完执行的内容
6import {ref,onMounted} from 'vue'这个onMounted就是挂载完执行的内容
gamemap里面画画墙
7 this.L=parseInt(Math.min(this.parent.clientWidth/this.cols,this.parent.clientHeight/this.rows))取为整数,否则有空格

8Math.random()随机0-1,,,g[r][c]=g[c][r]=true;有了随机数就把设置为true方便覆盖我们的颜色
13蛇从左下角,由上角出来
if(r==this.rows-2&&c==1||r==1&&c==this.cols-2)
14 const copy_g=JSON.parse(JSON.stringify(g))转化为json,再吧json解析出来
15设置页面图片

浙公网安备 33010602011771号