Commit 587a5571 authored by haiyoucuv's avatar haiyoucuv

5

parent d036a9bd
......@@ -8,12 +8,12 @@ import { Level2 } from "@/pages/GamePage/Level/Level2.ts";
import { Level3 } from "@/pages/GamePage/Level/Level3.ts";
import { Level4 } from "@/pages/GamePage/Level/Level4.ts";
import { Level5 } from "@/pages/GamePage/Level/Level5.ts";
import { Level7 } from "@/pages/GamePage/Level/Level7.ts";
import { Level8 } from "@/pages/GamePage/Level/Level8.ts";
import { Level23 } from "@/pages/GamePage/Level/Level23.ts";
import gameStore from "@/store/gameStore.ts";
import { LevelArr } from "@/pages/GamePage/Level/LevelConfig.ts";
import { LevelBase } from "@/pages/GamePage/Components/LevelBase.ts";
import { Level7 } from "@/pages/GamePage/Level/Level7.ts";
@observer
export class Game extends Base {
......
......@@ -115,7 +115,7 @@ class GamePage extends React.Component<any, any> {
<div className={styles.cd}>180s</div>
<img
src={new URL(`../../assets/GamePage/title/title${titleIdx}.png?x-oss-process=image/format,webp`, import.meta.url).href}
src={new URL(`../../assets/GamePage/title/title${levelIndex+1}.png?x-oss-process=image/format,webp`, import.meta.url).href}
className={styles.title}
/>
<Button className={styles.tipBtn} onClick={this.clickTip}/>
......
......@@ -42,7 +42,7 @@ export class Level23 extends LevelBase {
}
onTapOption(item: Sprite) {
const isRight = item === this.A;
const isRight = item === this.C;
this.setTouchEnable(false);
const dp = -9;
const wait = 2000;
......
import { LevelBase } from "@/pages/GamePage/Components/LevelBase.ts";
import { Assets, Sprite } from "pixi.js";
import { Tween } from "@/core/tween";
import { Ease, Tween } from "@/core/tween";
import { GameEvent, globalEvent } from "@/pages/GamePage/GameEvent.ts";
export class Level5 extends LevelBase {
......@@ -31,8 +31,8 @@ export class Level5 extends LevelBase {
this.A.position.set(201, 775);
this.right = this.addChild(new Sprite(Assets.get(`level${this.level}/right.png`)));
this.right.position.set(371, 993)
this.right.visible = false;
this.right.position.set(371, 993);
this.right.alpha = 0;
this.right.interactive = false;
this.error = this.addChild(new Sprite(Assets.get(`level${this.level}/error.png`)));
......@@ -87,12 +87,34 @@ export class Level5 extends LevelBase {
const nx = x - this.pos.x;
const ny = y - this.pos.y;
this.A.position.set(nx, ny);
if (
nx >= 400
&& nx <= 500
&& ny >= 1000
&& ny <= 1120
) {
this.setTouchEnable(false);
Tween.get(this.A)
.to({ x: 439, y: 1073 }, 444, Ease.quadInOut)
.call(() => {
Tween.get(this.right)
.to({ alpha: 1 }, 444, Ease.quadInOut)
.wait(2000)
.call(() => {
globalEvent.emit(GameEvent.NextLevel);
});
})
}
}
onDestroy() {
super.onDestroy();
Tween.removeTweens(this.A);
Tween.removeTweens(this.error);
Tween.removeTweens(this.right);
this.A.off("globalpointermove", this.onAPointerMove, this);
}
}
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