Commit 2faf7692 authored by cc's avatar cc
parents 37c501a8 bc8767ff
...@@ -35,7 +35,7 @@ class App extends Component { ...@@ -35,7 +35,7 @@ class App extends Component {
myPrize: MyPrize, // TODO 举例子 新宿台奖品页 myPrize: MyPrize, // TODO 举例子 新宿台奖品页
index: LoadingDemo, index: LoadingDemo,
sharepage:SharePage, sharepage:SharePage,
}[skinId] || HomePage; }[skinId] || GamePage;
PageCtrl.changePage(defaultPage); PageCtrl.changePage(defaultPage);
} }
......
...@@ -37,7 +37,7 @@ export async function initBundle(): Promise<void> { ...@@ -37,7 +37,7 @@ export async function initBundle(): Promise<void> {
manifest: manifest, manifest: manifest,
skipDetections: true, skipDetections: true,
preferences: { preferences: {
// preferWorkers: false, preferWorkers: false,
// preferCreateImageBitmap: true, // preferCreateImageBitmap: true,
} }
}); });
......
...@@ -8,6 +8,7 @@ import { Level2 } from "@/pages/GamePage/Level/Level2.ts"; ...@@ -8,6 +8,7 @@ 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 { Level6 } from "@/pages/GamePage/Level/Level6.ts";
import { Level7 } from "@/pages/GamePage/Level/Level7.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 { Level9 } from "@/pages/GamePage/Level/Level9.ts"; import { Level9 } from "@/pages/GamePage/Level/Level9.ts";
...@@ -15,6 +16,8 @@ import { Level10 } from "@/pages/GamePage/Level/Level10.ts"; ...@@ -15,6 +16,8 @@ import { Level10 } from "@/pages/GamePage/Level/Level10.ts";
import { Level13 } from "@/pages/GamePage/Level/Level13.ts"; import { Level13 } from "@/pages/GamePage/Level/Level13.ts";
import { Level14 } from "@/pages/GamePage/Level/Level14.ts"; import { Level14 } from "@/pages/GamePage/Level/Level14.ts";
import { Level18 } from "@/pages/GamePage/Level/Level18.ts"; import { Level18 } from "@/pages/GamePage/Level/Level18.ts";
import { Level21 } from "@/pages/GamePage/Level/Level21.ts";
import { Level22 } from "@/pages/GamePage/Level/Level22.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";
...@@ -29,7 +32,7 @@ export class Game extends Base { ...@@ -29,7 +32,7 @@ export class Game extends Base {
const qsBg = this.addChild(new Sprite(Assets.get("问题.png"))); const qsBg = this.addChild(new Sprite(Assets.get("问题.png")));
qsBg.position.set(49, 316); qsBg.position.set(49, 316);
this.level = this.addChild(new Level18()); this.level = this.addChild(new Level21());
gameStore.start(); gameStore.start();
......
import { LevelBase } from "@/pages/GamePage/Components/LevelBase.ts";
import { Assets, Rectangle, Sprite } from "pixi.js";
import { Ease, Tween } from "@/core/tween";
import { GameEvent, globalEvent } from "@/pages/GamePage/GameEvent.ts";
export class Level21 extends LevelBase {
level: number = 21;
A: Sprite;
B: Sprite;
right: Sprite;
onLoad() {
super.onLoad();
this.A = this.addChild(new Sprite(Assets.get(`level${this.level}/A.png`)));
this.A.position.set(162, 835);
this.B = this.addChild(new Sprite(Assets.get(`level${this.level}/A.png`)));
this.B.position.set(443, 835);
this.right = this.addChild(new Sprite(Assets.get(`level${this.level}/right.png`)));
this.right.position.set(452, 1242);
this.right.alpha = 0;
this.right.interactive = false;
this.right.eventMode = "none";
[this.A, this.B].forEach((item) => {
item.on("pointerdown", this.onAPointerDown, this);
item.on("pointerup", this.onAPointerUp, this);
item.on("globalpointermove", this.onAPointerMove, this);
});
}
target = null;
pos = null;
onAPointerUp(e) {
this.pos = null;
}
onAPointerDown(e) {
this.target = e.target;
const { x, y } = e.data.global;
this.pos = {
x: x - e.target.x,
y: y - e.target.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.target.position.set(nx, ny);
this.check();
}
check() {
const { x: ax, y: ay, width: aw, height: ah } = this.A;
const { x: bx, y: by, width: bw, height: bh } = this.B;
const edge = 20;
const isIns = new Rectangle(ax + edge, ay + edge, aw - edge * 2, ah - edge * 2)
.intersects(new Rectangle(bx + edge, by + edge, bw - edge * 2, bh - edge * 2));
if (isIns) {
this.setTouchEnable(false);
this.right.position.set(bx - 30, by - 30);
Tween.get(this.B).to({ alpha: 0 }, 666, Ease.quadInOut);
Tween.get(this.right)
.to({ alpha: 1 }, 666, Ease.quadInOut)
.wait(2000)
.call(() => {
globalEvent.emit(GameEvent.NextLevel);
});
}
}
onDestroy() {
super.onDestroy();
Tween.removeTweens(this.right);
[this.A, this.B].forEach((item) => {
item.off("globalpointermove", this.onAPointerMove, this);
});
}
}
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 Level22 extends LevelBase {
level: number = 22;
A: Sprite;
B: Sprite;
right: Sprite;
onLoad() {
super.onLoad();
this.addChild(new Sprite(Assets.get(`level${this.level}/底.png`)))
.position.set(194, 697);
this.B = this.addChild(new Sprite(Assets.get(`level${this.level}/裤子.png`)));
this.B.position.set(267, 1119);
this.A = this.addChild(new Sprite(Assets.get(`level${this.level}/衣服.png`)));
this.A.position.set(195, 808);
const x = this.addChild(new Sprite(Assets.get(`level${this.level}/头.png`)))
x.position.set(282, 697);
x.interactive = false;
x.eventMode = "none";
this.right = this.addChild(new Sprite(Assets.get(`level${this.level}/right.png`)));
this.right.position.set(452, 1242);
this.right.alpha = 0;
this.right.interactive = false;
this.right.eventMode = "none";
[this.A, this.B].forEach((item) => {
item.on("pointerdown", this.onAPointerDown, this);
item.on("pointerup", this.onAPointerUp, this);
item.on("globalpointermove", this.onAPointerMove, this);
});
}
target = null;
pos = null;
onAPointerUp(e) {
this.pos = null;
}
onAPointerDown(e) {
this.target = e.target;
const { x, y } = e.data.global;
this.pos = {
x: x - e.target.x,
y: y - e.target.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.target.position.set(nx, ny);
this.check();
}
check() {
const { x: ax, y: ay } = this.A;
const { x: bx, y: by } = this.B;
if (
(ax < 0 || ax > 425 || ay < 600 || ay > 970)
&& (bx < 80 || bx > 450 || by < 840 || by > 1200)
) {
this.setTouchEnable(false);
Tween.get(this.right)
.to({ alpha: 1 }, 666, Ease.quadInOut)
.wait(2000)
.call(() => {
globalEvent.emit(GameEvent.NextLevel);
});
}
}
onDestroy() {
super.onDestroy();
Tween.removeTweens(this.right);
[this.A, this.B].forEach((item) => {
item.off("globalpointermove", this.onAPointerMove, this);
});
}
}
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 Level6 extends LevelBase {
level: number = 6;
A: Sprite;
B: Sprite;
C: Sprite;
right: Sprite;
onLoad() {
super.onLoad();
this.C = this.addChild(new Sprite(Assets.get(`level${this.level}/C.png`)));
this.C.position.set(199, 821);
this.B = this.addChild(new Sprite(Assets.get(`level${this.level}/B.png`)));
this.B.position.set(226, 789);
this.A = this.addChild(new Sprite(Assets.get(`level${this.level}/A.png`)));
this.A.position.set(266, 672);
this.right = this.addChild(new Sprite(Assets.get(`level${this.level}/right.png`)));
this.right.position.set(103, 1069);
this.right.alpha = 0;
this.right.interactive = false;
this.right.eventMode = "none";
const x = this.addChild(new Sprite(Assets.get(`level${this.level}/叉子.png`)))
x.position.set(286, 1152);
x.interactive = false;
x.eventMode = "none";
[this.A, this.B, this.C].forEach((item) => {
item.on("pointerdown", this.onAPointerDown, this);
item.on("pointerup", this.onAPointerUp, this);
item.on("globalpointermove", this.onAPointerMove, this);
});
}
target = null;
pos = null;
onAPointerUp(e) {
this.pos = null;
}
onAPointerDown(e) {
this.target = e.target;
const { x, y } = e.data.global;
this.pos = {
x: x - e.target.x,
y: y - e.target.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.target.position.set(nx, ny);
this.check();
}
check() {
const { x, y } = this.C;
if (x >= 80 && x <= 230 && y >= 1030 && y <= 1100) {
this.setTouchEnable(false);
Tween.get(this.C)
.to({ x: 129, y: 1049 }, 666, Ease.quadInOut);
Tween.get(this.right)
.wait(666)
.to({ alpha: 1 }, 666, Ease.quadInOut)
.wait(2000)
.call(() => {
globalEvent.emit(GameEvent.NextLevel);
});
}
}
onDestroy() {
super.onDestroy();
Tween.removeTweens(this.right);
[this.A, this.B, this.C].forEach((item) => {
item.off("globalpointermove", this.onAPointerMove, this);
});
}
}
...@@ -3,6 +3,7 @@ import { Level2 } from "@/pages/GamePage/Level/Level2.ts"; ...@@ -3,6 +3,7 @@ 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 { Level6 } from "@/pages/GamePage/Level/Level6.ts";
import { Level7 } from "@/pages/GamePage/Level/Level7.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 { Level9 } from "@/pages/GamePage/Level/Level9.ts"; import { Level9 } from "@/pages/GamePage/Level/Level9.ts";
...@@ -10,6 +11,8 @@ import { Level10 } from "@/pages/GamePage/Level/Level10.ts"; ...@@ -10,6 +11,8 @@ import { Level10 } from "@/pages/GamePage/Level/Level10.ts";
import { Level13 } from "@/pages/GamePage/Level/Level13.ts"; import { Level13 } from "@/pages/GamePage/Level/Level13.ts";
import { Level14 } from "@/pages/GamePage/Level/Level14.ts"; import { Level14 } from "@/pages/GamePage/Level/Level14.ts";
import { Level18 } from "@/pages/GamePage/Level/Level18.ts"; import { Level18 } from "@/pages/GamePage/Level/Level18.ts";
import { Level21 } from "@/pages/GamePage/Level/Level21.ts";
import { Level22 } from "@/pages/GamePage/Level/Level22.ts";
import { Level23 } from "@/pages/GamePage/Level/Level23.ts"; import { Level23 } from "@/pages/GamePage/Level/Level23.ts";
...@@ -19,23 +22,23 @@ export const LevelArr = [ ...@@ -19,23 +22,23 @@ export const LevelArr = [
{ cls: Level3, tip: `当然是太阳最高啦` }, { cls: Level3, tip: `当然是太阳最高啦` },
{ cls: Level4, tip: `没有什么比猫猫的<br/>左右爪更像了` }, { cls: Level4, tip: `没有什么比猫猫的<br/>左右爪更像了` },
{ cls: Level5, tip: `将蛋黄放在蛋白上<br/>拼出荷包蛋` }, { cls: Level5, tip: `将蛋黄放在蛋白上<br/>拼出荷包蛋` },
{ cls: Level5, tip: `直接移动最底层的蛋糕` }, // 6 { cls: Level6, tip: `直接移动最底层的蛋糕` },
{ cls: Level7, tip: `旋转存钱罐,倒出金币` }, { cls: Level7, tip: `旋转存钱罐,倒出金币` },
{ cls: Level8, tip: `最深的颜色是题目` }, { cls: Level8, tip: `最深的颜色是题目` },
{ cls: Level9, tip: `移动小鸭子至河边` }, { cls: Level9, tip: `移动小鸭子至河边` },
{ cls: Level10, tip: `将“1”移动至等号右边<br/>形成等式` }, // 10 { cls: Level10, tip: `将“1”移动至等号右边<br/>形成等式` },
{ cls: Level9, tip: `将冰箱放大至能装够装下<br/>长颈鹿` }, // 11 { cls: Level9, tip: `将冰箱放大至能装够装下<br/>长颈鹿` }, // 11
{ cls: Level9, tip: `掐断烟头` }, // 12 { cls: Level9, tip: `掐断烟头` }, // 12
{ cls: Level13, tip: `打开盖子看看` }, // 13 { cls: Level13, tip: `打开盖子看看` },
{ cls: Level14, tip: `将香蕉移动到牛奶中<br/>变成香蕉牛奶` }, { cls: Level14, tip: `将香蕉移动到牛奶中<br/>变成香蕉牛奶` },
{ cls: Level14, tip: `猫吃老鼠` }, // 15 { cls: Level14, tip: `猫吃老鼠` }, // 15
{ cls: Level14, tip: `移动笼子罩住小鸭子` }, // 16 { cls: Level14, tip: `移动笼子罩住小鸭子` }, // 16
{ cls: Level14, tip: `别忘了,人是高等动物哦` }, // 17 { cls: Level14, tip: `别忘了,人是高等动物哦` }, // 17
{ cls: Level18, tip: `移开乌云露出太阳<br/>让冰块融化` }, // 18 { cls: Level18, tip: `移开乌云露出太阳<br/>让冰块融化` },
{ cls: Level14, tip: `将冰箱放大至能够装下长颈鹿` }, // 19 { cls: Level14, tip: `将冰箱放大至能够装下长颈鹿` }, // 19
{ cls: Level14, tip: `别忘了把题目也装进箱子里` }, // 20 { cls: Level14, tip: `别忘了把题目也装进箱子里` }, // 20
{ cls: Level14, tip: `移动鸡蛋,碰一碰便知` }, // 21 { cls: Level21, tip: `移动鸡蛋,碰一碰便知` }, // 21
{ cls: Level14, tip: `移开圣诞老人的衣服看看` }, // 22 { cls: Level22, tip: `移开圣诞老人的衣服看看` },
{ cls: Level23, tip: `一样重` }, { cls: Level23, tip: `一样重` },
{ cls: Level23, tip: `将雪球合在一起滚成大雪球` }, // 24 { cls: Level23, tip: `将雪球合在一起滚成大雪球` }, // 24
{ cls: Level23, tip: `按住小猪鼻子,把它憋醒` }, // 25 { cls: Level23, tip: `按住小猪鼻子,把它憋醒` }, // 25
......
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