如题,正确的代码是:
onLoop():void{
this.y+=50;
if (this.bg1.y+this.y>=852) {
this.bg1.y-=852*2;
}
if (this.bg2.y+this.y>=852) {
this.bg2.y-=852*2;
}
}
我尝试的代码是:[code] onLoop():void{
this.y+=50;
if (this.bg1.y>=852) {
this.y-=852*2;
this.bg1.y-=852*2;
}
if (this.bg2.y>=852) {
this.y-=852*2;
this.bg2.y-=852*2;
}
} [/code]但是窝尝试的代码不能够循环出现背景,请问“t
this.bg1.y+this.y”这里的计算方式为什么是这样的呢?