move clouds separately

This commit is contained in:
Daniel Bulant 2021-04-09 09:29:46 +02:00
parent 5ae820def0
commit 226b081c16

View file

@ -200,7 +200,16 @@ export class GameScene extends Phaser.Scene {
if(this.items[toX][toY].type !== "lyre") return; if(this.items[toX][toY].type !== "lyre") return;
if(toX + moveX > this.map.size.x - 1|| toX + moveX < 0 || toY + moveY > this.map.size.y - 1 || toY + moveY < 0) return; if(toX + moveX > this.map.size.x - 1|| toX + moveX < 0 || toY + moveY > this.map.size.y - 1 || toY + moveY < 0) return;
if(this.items[toX + moveX][toY + moveY] && this.items[toX + moveX][toY + moveY].type !== "wind") return; if(this.items[toX + moveX][toY + moveY] && this.items[toX + moveX][toY + moveY].type !== "wind") return;
this.move(toX, toY, toX + moveX, toY + moveY); if(stepNum <= 0) {
this.unload();
this.createMap();
return;
}
this.canMove = false;
this.move(toX, toY, toX + moveX, toY + moveY, () => {
this.canMove = true;
});
return;
} }
if(stepNum <= 0) { if(stepNum <= 0) {
this.unload(); this.unload();