在chrome下没问题,移植到微信小程序就。。
继承关系: upPencil extend pencils extend sprite
export class upPencil extends pencils{
constructor(passTop){
const image = dataStore.getInstance().res.get('upPencil');
const y = passTop - image.height;
super(image,y);
this.type = "up"
}
draw(){
super.draw()
}
}
调用开始处:
pencil.draw(); //画出每个铅笔
pencils中出错位置
_get(pencils.prototype.__proto__ || Object.getPrototypeOf(pencils.prototype), "draw", this).call(this);
pencil中出错位置
_createClass(upPencil, [{
key: "draw",
value: function draw() {
//this.y = this.top -this.srcH;
_get(upPencil.prototype.__proto__ || Object.getPrototypeOf(upPencil.prototype), "draw", this).call(this);
}
}]);