Commit 00619e4c authored by haiyoucuv's avatar haiyoucuv

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/pages/GamePage/Game.ts
parents 9c7d0d50 852364b3
......@@ -99,10 +99,10 @@
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
}
</script>
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1747982309021/assets/index-Dl-xTHIV.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747982309021/assets/vendor-Bq4lO2GB.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747982309021/assets/vendor-NZxPxbcK.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747982309021/assets/index-CCbTtttf.css">
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1747984799021/assets/index-C52CwPko.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747984799021/assets/vendor-BYa0zRtf.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747984799021/assets/vendor-NZxPxbcK.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747984799021/assets/index-DO8zblru.css">
<script type="module">import.meta.url;import("_").catch(()=>1);(async function*(){})().next();if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script>
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
</head>
......@@ -110,8 +110,8 @@
<body>
<div id="root"></div>
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1747982309021/assets/polyfills-legacy-arANKBzQ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1747982309021/assets/index-legacy-BuuQJyuE.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1747984799021/assets/polyfills-legacy-arANKBzQ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1747984799021/assets/index-legacy-kUp2uCNx.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body>
</html>
\ No newline at end of file
......@@ -28,6 +28,7 @@ import { Level24 } from "@/pages/GamePage/Level/Level24.ts";
import gameStore from "@/store/gameStore.ts";
import { LevelArr } from "@/pages/GamePage/Level/LevelConfig.ts";
import { LevelBase } from "@/pages/GamePage/Components/LevelBase.ts";
import { Level16 } from "./Level/Level16.ts";
@observer
export class Game extends Base {
......
import { LevelBase } from "@/pages/GamePage/Components/LevelBase.ts";
import { Assets, Sprite } from "pixi.js";
import { Ease, Tween } from "@/core/tween";
import { GameEvent, globalEvent } from "@/pages/GamePage/GameEvent.ts";
export class Level16 extends LevelBase {
level: number = 16;
A: Sprite;
B: Sprite;
D: Sprite;
right: Sprite;
error: Sprite;
onLoad() {
super.onLoad();
// this.addChild(new Sprite(Assets.get(`level${this.level}/C.png`)))
// .position.set(207, 902);
this.B = this.addChild(new Sprite(Assets.get(`level${this.level}/B.png`)));
this.B.position.set(293, 1035);
this.A = this.addChild(new Sprite(Assets.get(`level${this.level}/A.png`)));
this.A.position.set(105, 667);
this.right = this.addChild(new Sprite(Assets.get(`level${this.level}/right.png`)));
this.right.position.set(560, 1185);
this.right.alpha = 0;
this.right.interactive = false;
this.right.eventMode = "none";
this.A.on("pointerdown", this.onAPointerDown, this);
this.A.on("pointerup", this.onAPointerUp, this);
this.A.on("globalpointermove", this.onAPointerMove, this);
}
pos = null;
onAPointerUp(e) {
this.pos = null;
}
onAPointerDown(e) {
const { x, y } = e.data.global;
this.pos = {
x: x - this.A.x,
y: y - this.A.y
}
}
onAPointerMove(e) {
if (!this.pos) return;
const { x, y } = e.data.global;
const nx = x - this.pos.x;
const ny = y - this.pos.y;
this.A.position.set(nx, ny);
if (
nx >= 0
&& nx <= 228
&& ny >= 920
&& ny <= 1034
) {
this.setTouchEnable(false);
// Tween.get(this.B).to({ alpha: 0 }, 444, Ease.quadInOut);
Tween.get(this.A)
.to({ x: 101, y: 946 }, 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.B);
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