怎么下面有一条黑色的?
来源:4-11 小游戏上下铅笔形管道的创建-2
慕粉175911202
2019-02-02
2回答
-
慕粉175911202
提问者
2019-02-03
这是地板代码,每个地方试一下,但还是没找出问题,能详细讲一下吗?实在是脑子不够用
import {Sprite} from "../base/Sprite.js";
import {Director} from "../Director.js";
export class Land extends Sprite{
constructor(){
const image = Sprite.getImage('land');
super(image,
0,0,
image.width,image.height,
0,window.innerHeight-image.height,
image.width,image.height);
this.landX=0;
this.landSpeed=Director.getInstance().moveSpeed;
}
draw(){
this.landX=this.landX + this.landSpeed;
if (this.landX >(this.img.width - window.innerWidth)){
this.landX=0;
}
super.draw(this.img,
this.srcX,
this.srcY,
this.srcW,
this.srcH,
-this.landX,
this.y,
this.width,
this.height)
}
}00 -
傅猿猿
2019-02-02
因为你没有把地板正确渲染啊,还有chrome模拟器开到iPhone8左右大小
00
相似问题