Commit 4553efeb authored by wildfirecode13's avatar wildfirecode13

1

parent f9d40ee5
No preview for this file type
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -167,11 +167,11 @@ export default class GameView extends engine.Container { ...@@ -167,11 +167,11 @@ export default class GameView extends engine.Container {
this.goldBags.splice(0); this.goldBags.splice(0);
//this.addGoldBag(); //this.addGoldBag();
this.playZoom('in'); // this.playZoom('in');
await this.resetPlayer(revive); this.resetPlayer(revive);
} }
async resetPlayer(revive = false) { resetPlayer(revive = false) {
this.player.reset(revive); this.player.reset(revive);
this.player.y = this.baseOffset - (this.index + 1) * props.blockHitHeight+props.blockBaseOffset; this.player.y = this.baseOffset - (this.index + 1) * props.blockHitHeight+props.blockBaseOffset;
} }
...@@ -219,7 +219,7 @@ export default class GameView extends engine.Container { ...@@ -219,7 +219,7 @@ export default class GameView extends engine.Container {
this.blockContainer.getChildAt(this.index).visible = false; this.blockContainer.getChildAt(this.index).visible = false;
this.index--; this.index--;
await this.resetPlayer(true); await this.resetPlayer(true);
await this.playZoom('in'); // await this.playZoom('in');
this.start(true); this.start(true);
} }
...@@ -433,16 +433,5 @@ export default class GameView extends engine.Container { ...@@ -433,16 +433,5 @@ export default class GameView extends engine.Container {
this.frontContainer.addChild(hitEffect); this.frontContainer.addChild(hitEffect);
} }
playZoom(type: 'in' | 'out', duration = 700) {
this.background.playZoom(type, duration);
let count = this.stage.height / props.blockHitHeight;
return new Promise(resolve => {
this.frontContainer.anchorY = -props.blockHitHeight * (this.index + count * 1.3) + props.baseOffset;
let scale = type === 'in' ? 1 : /*Math.max(*/Math.min((this.stage.height / props.blockHitHeight / (this.index + count)), props.maxScale)/*, props.minScale)*/;
console.log(scale);
engine.Tween.get(this.frontContainer, null, null, true)
.to({scaleX: scale, scaleY: scale}, duration, engine.Ease.cubicInOut)
.call(resolve);
})
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment