【constructor】在一个函数的原型上新增了一个方法,但是通过函数.方法名去调用就会报错,但是在函数的原型上可以看到那个方法
function Game(){
this.dom = document.querySelector('#canvas')
this.ctx = this.dom.getContext('2d')
this.R = {
'changge':'./images/wyyc.png',
'sea':'./images/xxdj.png',
...
原创
2021-04-19 15:04:24 ·
131 阅读 ·
0 评论