Commit 587a5571 authored by haiyoucuv's avatar haiyoucuv

5

parent d036a9bd
...@@ -8,12 +8,12 @@ import { Level2 } from "@/pages/GamePage/Level/Level2.ts"; ...@@ -8,12 +8,12 @@ import { Level2 } from "@/pages/GamePage/Level/Level2.ts";
import { Level3 } from "@/pages/GamePage/Level/Level3.ts"; import { Level3 } from "@/pages/GamePage/Level/Level3.ts";
import { Level4 } from "@/pages/GamePage/Level/Level4.ts"; import { Level4 } from "@/pages/GamePage/Level/Level4.ts";
import { Level5 } from "@/pages/GamePage/Level/Level5.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 { Level8 } from "@/pages/GamePage/Level/Level8.ts";
import { Level23 } from "@/pages/GamePage/Level/Level23.ts"; import { Level23 } from "@/pages/GamePage/Level/Level23.ts";
import gameStore from "@/store/gameStore.ts"; import gameStore from "@/store/gameStore.ts";
import { LevelArr } from "@/pages/GamePage/Level/LevelConfig.ts"; import { LevelArr } from "@/pages/GamePage/Level/LevelConfig.ts";
import { LevelBase } from "@/pages/GamePage/Components/LevelBase.ts"; import { LevelBase } from "@/pages/GamePage/Components/LevelBase.ts";
import { Level7 } from "@/pages/GamePage/Level/Level7.ts";
@observer @observer
export class Game extends Base { export class Game extends Base {
......
...@@ -115,7 +115,7 @@ class GamePage extends React.Component<any, any> { ...@@ -115,7 +115,7 @@ class GamePage extends React.Component<any, any> {
<div className={styles.cd}>180s</div> <div className={styles.cd}>180s</div>
<img <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} className={styles.title}
/> />
<Button className={styles.tipBtn} onClick={this.clickTip}/> <Button className={styles.tipBtn} onClick={this.clickTip}/>
......
...@@ -42,7 +42,7 @@ export class Level23 extends LevelBase { ...@@ -42,7 +42,7 @@ export class Level23 extends LevelBase {
} }
onTapOption(item: Sprite) { onTapOption(item: Sprite) {
const isRight = item === this.A; const isRight = item === this.C;
this.setTouchEnable(false); this.setTouchEnable(false);
const dp = -9; const dp = -9;
const wait = 2000; const wait = 2000;
......
import { LevelBase } from "@/pages/GamePage/Components/LevelBase.ts"; import { LevelBase } from "@/pages/GamePage/Components/LevelBase.ts";
import { Assets, Sprite } from "pixi.js"; 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"; import { GameEvent, globalEvent } from "@/pages/GamePage/GameEvent.ts";
export class Level5 extends LevelBase { export class Level5 extends LevelBase {
...@@ -31,8 +31,8 @@ export class Level5 extends LevelBase { ...@@ -31,8 +31,8 @@ export class Level5 extends LevelBase {
this.A.position.set(201, 775); this.A.position.set(201, 775);
this.right = this.addChild(new Sprite(Assets.get(`level${this.level}/right.png`))); this.right = this.addChild(new Sprite(Assets.get(`level${this.level}/right.png`)));
this.right.position.set(371, 993) this.right.position.set(371, 993);
this.right.visible = false; this.right.alpha = 0;
this.right.interactive = false; this.right.interactive = false;
this.error = this.addChild(new Sprite(Assets.get(`level${this.level}/error.png`))); this.error = this.addChild(new Sprite(Assets.get(`level${this.level}/error.png`)));
...@@ -87,12 +87,34 @@ export class Level5 extends LevelBase { ...@@ -87,12 +87,34 @@ export class Level5 extends LevelBase {
const nx = x - this.pos.x; const nx = x - this.pos.x;
const ny = y - this.pos.y; const ny = y - this.pos.y;
this.A.position.set(nx, ny); 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() { onDestroy() {
super.onDestroy(); super.onDestroy();
Tween.removeTweens(this.A);
Tween.removeTweens(this.error); Tween.removeTweens(this.error);
Tween.removeTweens(this.right); 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