Commit 010b1d56 authored by cc's avatar cc
parents d6112d33 a94342d9
export default [ export default [
{ {
url: '/draw/index.do', url: '/ndj/index.do',
method: 'get', method: 'get',
response: ({ query }) => { response: ({ query }) => {
return { return {
"success": true, "success": true,
"message": "报错了~", "message": "信息",
"code": null, "code": "123",
timeStamp: Date.now(),
"data": { "data": {
"remainDrawTimes": 3, // 抽奖次数 "remainDrawTimes": 157, // 抽奖次数
"prizeVOs": [ "prizeInfo": [
{ {
prizeName: `奖品1`, "prizeName": `奖品1`,
prizeImg: `//yun.duiba.com.cn/polaris/jinmoqiang.9e5bbc004f69ab6a3f34d93daeda028616a9f00d.png`, "prizeImg": `//yun.duiba.com.cn/polaris/jinmoqiang.9e5bbc004f69ab6a3f34d93daeda028616a9f00d.png`,
prizeId: `1`, // prizeId: `1`,
}, },
{ {
prizeName: `奖品名称2`, "prizeName": `奖品2`,
prizeImg: `//yun.duiba.com.cn/polaris/kouzhao.dc55dac6db1ff94c4666c2602d6cb0ac84139982.png`, "prizeImg": `//yun.duiba.com.cn/polaris/jinmoqiang.9e5bbc004f69ab6a3f34d93daeda028616a9f00d.png`,
prizeId: `2`, // prizeId: `2`,
}, },
{ {
prizeName: `奖品名称3`, "prizeName": `奖品名称3`,
prizeImg: `//yun.duiba.com.cn/polaris/mac.fe55aa43e5a231d568973dcdd0b91e0263d5a12c.png`, "prizeImg": `//yun.duiba.com.cn/polaris/mac.fe55aa43e5a231d568973dcdd0b91e0263d5a12c.png`,
prizeId: `3`, // prizeId: `3`,
}, },
{ {
prizeName: `奖品名称4`, "prizeName": `奖品名称4`,
prizeImg: `//yun.duiba.com.cn/polaris/mgtv.e5f0709a2a4083bc57ce52ff200a50a2e56b2658.png`, "prizeImg": `//yun.duiba.com.cn/polaris/mgtv.e5f0709a2a4083bc57ce52ff200a50a2e56b2658.png`,
prizeId: `4`, // prizeId: `4`,
}, },
{ {
prizeName: `奖品名称5`, "prizeName": `奖品名称5`,
prizeImg: `//yun.duiba.com.cn/polaris/qq.73ad13cd0c6fd705327d12957c12e9d5b2e77baa.png`, "prizeImg": `//yun.duiba.com.cn/polaris/qq.73ad13cd0c6fd705327d12957c12e9d5b2e77baa.png`,
prizeId: `5`, // prizeId: `5`,
}, },
{ {
prizeName: `谢谢参与`, "prizeName": `谢谢参与`,
prizeImg: `https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg`, "prizeImg": `https://yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg`,
prizeId: `thanks`, // prizeId: `thanks`,
}, },
] ]
} }
...@@ -48,17 +47,15 @@ export default [ ...@@ -48,17 +47,15 @@ export default [
}, },
{ {
url: '/draw/doDraw.do', url: '/ndj/draw.do',
method: 'get', method: 'get',
response: ({ query }) => { response: ({ query }) => {
return { return {
"code": "", "code": "123",
"message": null, "message": "信息xxx",
"success": true, "success": true,
"data": { "data": {
"prizeName": "", "boolPrize": true, // true-中奖,取prizeInfo信息,false-为中奖,取productInfo
"prizeId": "1",
"prizeImg": "",
"productInfos": [ "productInfos": [
{ {
"productImg": "//yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg", "productImg": "//yun.duiba.com.cn/spark/assets/f77861647e7b55e9c95e9c49d891a21526157a76.jpg",
...@@ -72,9 +69,12 @@ export default [ ...@@ -72,9 +69,12 @@ export default [
"productImg": "//yun.duiba.com.cn/polaris/mgtv.e5f0709a2a4083bc57ce52ff200a50a2e56b2658.png", "productImg": "//yun.duiba.com.cn/polaris/mgtv.e5f0709a2a4083bc57ce52ff200a50a2e56b2658.png",
"productText": "介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3" "productText": "介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3介绍3"
} }
] ],
}, "prizeInfo": {
"timeStamp": 1739176246085 "prizeName": "reprehenderit tempor non",
"prizeImg": "Duis veniam ipsum voluptate eiusmod"
}
}
} }
}, },
} }
......
...@@ -21,8 +21,8 @@ export default [ ...@@ -21,8 +21,8 @@ export default [
}, },
"rulePop": false, "rulePop": false,
"userId": "qui id deserunt", "userId": "qui id deserunt",
"validUid": "Lorem labore occaecat sed quis", "validUid": true,
"isAgent": "true", "isAgent": true,
"boundYkCode": "eiusmod in dolor", "boundYkCode": "eiusmod in dolor",
"minim_0": 93293912 "minim_0": 93293912
} }
......
...@@ -4177,7 +4177,7 @@ packages: ...@@ -4177,7 +4177,7 @@ packages:
resolution: {integrity: sha1-ZtE2jae9+SHrnZW9GpIp5/IaQ+4=} resolution: {integrity: sha1-ZtE2jae9+SHrnZW9GpIp5/IaQ+4=}
sa-sdk-javascript@1.27.4: sa-sdk-javascript@1.27.4:
resolution: {integrity: sha512-w0Kv237KHDjH1amgchECzzC9c1aruC0LMgqgYC/ISTfijRroJAEQrVPDvHJqJpD8uD1+spN7q6hgfT3x+EncmQ==, tarball: http://npm.dui88.com:80/sa-sdk-javascript/-/sa-sdk-javascript-1.27.4.tgz} resolution: {integrity: sha512-w0Kv237KHDjH1amgchECzzC9c1aruC0LMgqgYC/ISTfijRroJAEQrVPDvHJqJpD8uD1+spN7q6hgfT3x+EncmQ==}
safe-buffer@5.1.2: safe-buffer@5.1.2:
resolution: {integrity: sha1-mR7GnSluAxN0fVm9/St0XDX4go0=} resolution: {integrity: sha1-mR7GnSluAxN0fVm9/St0XDX4go0=}
...@@ -4460,7 +4460,7 @@ packages: ...@@ -4460,7 +4460,7 @@ packages:
typescript: '>=4.8.4' typescript: '>=4.8.4'
tslib@2.8.1: tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==, tarball: http://npm.dui88.com:80/tslib/-/tslib-2.8.1.tgz} resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tweedle.js@2.1.0: tweedle.js@2.1.0:
resolution: {integrity: sha512-0ReQgVjepoZkE6t0upWNgCRbplHkQJQYk1LStXugwSR728GLFmGDRuaQJlxeC/iBlxud6+P1RdODjaO25vHAqw==} resolution: {integrity: sha512-0ReQgVjepoZkE6t0upWNgCRbplHkQJQYk1LStXugwSR728GLFmGDRuaQJlxeC/iBlxud6+P1RdODjaO25vHAqw==}
......
...@@ -125,11 +125,11 @@ const API = generateAPI({ ...@@ -125,11 +125,11 @@ const API = generateAPI({
}, },
/** 抽奖首页 */ /** 扭蛋机首页 */
drawIndex: "draw/index.do", drawIndex: "ndj/index.do",
/** 抽奖 */ /** 扭蛋机抽奖 */
drawJoin: { drawJoin: {
uri: "draw/doDraw.do", uri: "ndj/draw.do",
withToken: true, withToken: true,
}, },
......
...@@ -18,10 +18,11 @@ import Homepage from "../HomePage/HomePage.tsx"; ...@@ -18,10 +18,11 @@ import Homepage from "../HomePage/HomePage.tsx";
import machineSvga from "../../assets/svga/1输出扭蛋机常态.svga"; import machineSvga from "../../assets/svga/1输出扭蛋机常态.svga";
import normalSvga from "../../assets/svga/2输出待机啊.svga"; import normalSvga from "../../assets/svga/2输出待机啊.svga";
import dynamicSvga from "../../assets/svga/3输出出奖啊.svga"; import dynamicSvga from "../../assets/svga/3输出出奖啊.svga";
import output1Svga from "../../assets/svga/4中奖扭蛋.svga";
import output2Svga from "../../assets/svga/5中奖弹窗.svga";
// import { LOG_KEY, pageView, sensorLog } from '@src/utils/sensors'; // import { LOG_KEY, pageView, sensorLog } from '@src/utils/sensors';
@observer @observer
class Capsulepage extends React.Component { class Capsulepage extends React.Component {
constructor(props) { constructor(props) {
...@@ -29,10 +30,11 @@ class Capsulepage extends React.Component { ...@@ -29,10 +30,11 @@ class Capsulepage extends React.Component {
this.state = { this.state = {
drawInfo: {}, drawInfo: {},
btnDynamic: false, // 抽奖机是否动态中 btnDynamic: false, // 抽奖机是否动态中
btnOutput: false, // 开扭蛋效果是否启动
}; };
this.btnStarting = false; // 抽奖机是否启动 this.btnStarting = false; // 抽奖机是否启动
// this.turntableRef = null; // 大转盘 // this.turntableRef = null; // 大转盘
this.drawResultInfo = {}; // this.drawResultInfo = {};
} }
componentDidMount() { componentDidMount() {
...@@ -86,25 +88,30 @@ class Capsulepage extends React.Component { ...@@ -86,25 +88,30 @@ class Capsulepage extends React.Component {
// 抽奖次数为0 // 抽奖次数为0
if (!remainDrawTimes) { if (!remainDrawTimes) {
return Toast.show("抽奖次数不足,快去做任务赚次数吧~"); return Toast.show("抽奖次数不足,快去猜谜赚次数吧~");
} }
if (this.btnStarting) return false; if (this.btnStarting) return false;
this.btnStarting = true; this.btnStarting = true;
const { success, data } = await API.drawJoin(); const { success, data } = await API.drawJoin();
if (success && data) { if (success && data) {
// 抽奖机转动开始抽奖 // 扭蛋机转动开始抽奖
// this.turntableRef.launch(); // this.turntableRef.launch();
this.setState({ btnDynamic: true }); this.setState({ btnDynamic: true });
this.drawResultInfo = data || {}; // this.drawResultInfo = data || {};
const { boolPrzie, prizeInfo = {}, productInfo = [] } = data || {};
const { prizeName = "", prizeImg = "" } = prizeInfo || {};
// const index = prizeVOs?.findIndex(
// (item) => item.prizeId === (this.drawResultInfo.prizeId || "thanks")
// );
// console.info("index", index);
const index = prizeVOs?.findIndex(
(item) => item.prizeId === (this.drawResultInfo.prizeId || "thanks")
);
console.info("index", index);
// 抽奖机停止转动 // 抽奖机停止转动
setTimeout(() => { setTimeout(() => {
this.setState({ btnDynamic: false }); this.setState({ btnDynamic: false });
this.btnOutput = true;
this.stopOkHandle(); this.stopOkHandle();
}, 2000); }, 2000);
// this.turntableRef.braking(index); // this.turntableRef.braking(index);
...@@ -117,12 +124,19 @@ class Capsulepage extends React.Component { ...@@ -117,12 +124,19 @@ class Capsulepage extends React.Component {
// 抽奖停止处理 // 抽奖停止处理
stopOkHandle = () => { stopOkHandle = () => {
this.btnStarting = false; this.btnStarting = false;
setTimeout(() => {
if (!this.drawResultInfo?.prizeId) { this.setState({ btnOutput: false });
// modalStore.pushPop("NoPrizeCard", { data: this.drawResultInfo }) }, 2000);
// 此时判断是否中奖 true-中奖,取prizeInfo信息,false-为中奖,取productInfo
if (boolPrzie) {
// 中奖
ModalCtrl.pushPop("Pop_winprize", { prizeName, prizeImg });
} else { } else {
// modalStore.pushPop("Pop_winprize", { data: this.drawResultInfo }) // 没中奖
ModalCtrl.pushPop("NoPrizeCard", productInfo || []);
} }
this.getDrawInfo(); this.getDrawInfo();
}; };
...@@ -148,7 +162,7 @@ class Capsulepage extends React.Component { ...@@ -148,7 +162,7 @@ class Capsulepage extends React.Component {
}); });
render() { render() {
const { btnDynamic } = this.state; const { btnDynamic, btnOutput } = this.state;
const { prizeVOs, remainDrawTimes } = this.state.drawInfo; const { prizeVOs, remainDrawTimes } = this.state.drawInfo;
return ( return (
<div className="capsule modal_center"> <div className="capsule modal_center">
...@@ -166,6 +180,12 @@ class Capsulepage extends React.Component { ...@@ -166,6 +180,12 @@ class Capsulepage extends React.Component {
<SvgaPlayer className="normal" src={normalSvga} /> <SvgaPlayer className="normal" src={normalSvga} />
)} )}
<SvgaPlayer className="machine" src={machineSvga} /> <SvgaPlayer className="machine" src={machineSvga} />
{btnOutput && (
<>
<SvgaPlayer className="output1" src={output1Svga} />
<SvgaPlayer className="output2" src={output2Svga} />
</>
)}
{/* <div className="turantable"> {/* <div className="turantable">
<CircleTurntable <CircleTurntable
className="turantable_box" className="turantable_box"
......
...@@ -57,9 +57,20 @@ ...@@ -57,9 +57,20 @@
left: 114px; left: 114px;
} }
.fade-out { .output1 {
transition: opacity 0.3s ease-out; position: absolute;
opacity: 0; width: 750px;
height: 830px;
top: 427px;
// left: 114px;
}
.output2 {
position: absolute;
width: 750px;
height: 830px;
top: 427px;
// left: 114px;
} }
// .task_btn { // .task_btn {
......
...@@ -14,6 +14,7 @@ import { Level9 } from "@/pages/GamePage/Level/Level9.ts"; ...@@ -14,6 +14,7 @@ import { Level9 } from "@/pages/GamePage/Level/Level9.ts";
import { Level10 } from "@/pages/GamePage/Level/Level10.ts"; 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 { 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";
...@@ -28,7 +29,7 @@ export class Game extends Base { ...@@ -28,7 +29,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 Level13()); this.level = this.addChild(new Level18());
gameStore.start(); gameStore.start();
......
...@@ -36,11 +36,16 @@ export class Level10 extends LevelBase { ...@@ -36,11 +36,16 @@ export class Level10 extends LevelBase {
this.right.eventMode = "none"; this.right.eventMode = "none";
this.A.on("pointerdown", this.onAPointerDown, this); this.A.on("pointerdown", this.onAPointerDown, this);
this.A.on("pointerup", this.onAPointerUp, this);
this.A.on("globalpointermove", this.onAPointerMove, this); this.A.on("globalpointermove", this.onAPointerMove, this);
} }
pos = null; pos = null;
onAPointerUp(e) {
this.pos = null;
}
onAPointerDown(e) { onAPointerDown(e) {
const { x, y } = e.data.global; const { x, y } = e.data.global;
this.pos = { this.pos = {
......
...@@ -36,11 +36,16 @@ export class Level13 extends LevelBase { ...@@ -36,11 +36,16 @@ export class Level13 extends LevelBase {
this.right.eventMode = "none"; this.right.eventMode = "none";
this.C.on("pointerdown", this.onAPointerDown, this); this.C.on("pointerdown", this.onAPointerDown, this);
this.C.on("pointerup", this.onAPointerUp, this);
this.C.on("globalpointermove", this.onAPointerMove, this); this.C.on("globalpointermove", this.onAPointerMove, this);
} }
pos = null; pos = null;
onAPointerUp(e) {
this.pos = null;
}
onAPointerDown(e) { onAPointerDown(e) {
const { x, y } = e.data.global; const { x, y } = e.data.global;
this.pos = { this.pos = {
......
...@@ -41,6 +41,7 @@ export class Level14 extends LevelBase { ...@@ -41,6 +41,7 @@ export class Level14 extends LevelBase {
}); });
this.A.on("pointerdown", this.onAPointerDown, this); this.A.on("pointerdown", this.onAPointerDown, this);
this.A.on("pointerup", this.onAPointerUp, this);
this.A.on("globalpointermove", this.onAPointerMove, this); this.A.on("globalpointermove", this.onAPointerMove, this);
} }
...@@ -69,6 +70,10 @@ export class Level14 extends LevelBase { ...@@ -69,6 +70,10 @@ export class Level14 extends LevelBase {
pos = null; pos = null;
onAPointerUp(e) {
this.pos = null;
}
onAPointerDown(e) { onAPointerDown(e) {
const { x, y } = e.data.global; const { x, y } = e.data.global;
this.pos = { this.pos = {
......
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 Level18 extends LevelBase {
level: number = 18;
cloud1: Sprite;
cloud2: Sprite;
ice: Sprite;
ice2: Sprite;
right: Sprite;
onLoad() {
super.onLoad();
this.addChild(new Sprite(Assets.get(`level18/sun.png`)))
.position.set(267, 703);
this.cloud2 = this.addChild(new Sprite(Assets.get(`level18/cloud2.png`)));
this.cloud2.position.set(45, 743);
this.cloud1 = this.addChild(new Sprite(Assets.get(`level18/cloud1.png`)));
this.cloud1.position.set(176, 664);
this.ice = this.addChild(new Sprite(Assets.get(`level18/ice.png`)));
this.ice.position.set(259, 1031);
this.ice2 = this.addChild(new Sprite(Assets.get(`level18/ice2.png`)));
this.ice2.position.set(148, 1100);
this.right = this.addChild(new Sprite(Assets.get(`level18/right.png`)));
this.right.position.set(433, 1173);
this.right.alpha = 0;
this.right.interactive = false;
this.right.eventMode = "none";
this.cloud1.on("pointerdown", this.onAPointerDown, this);
this.cloud1.on("pointerup", this.onAPointerUp, this);
this.cloud1.on("globalpointermove", this.onAPointerMove, this);
this.cloud2.on("pointerdown", this.onAPointerDown, this);
this.cloud2.on("pointerup", this.onAPointerUp, this);
this.cloud2.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: c1x, y: c1y } = this.cloud1;
const { x: c2x, y: c2y } = this.cloud2;
if (
(c1x < -125 || c1x > 350 || c1y < 595 || c1y > 820)
&& (c2x < -125 || c2x > 350 || c2y < 595 || c2y > 820)
) {
this.setTouchEnable(false);
Tween.get(this.ice).to({ alpha: 0 }, 666, Ease.quadInOut);
Tween.get(this.ice2).wait(444).to({ alpha: 1 }, 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.ice);
Tween.removeTweens(this.ice2);
Tween.removeTweens(this.right);
this.cloud1.off("globalpointermove", this.onAPointerMove, this);
this.cloud2.off("globalpointermove", this.onAPointerMove, this);
}
}
...@@ -45,6 +45,7 @@ export class Level5 extends LevelBase { ...@@ -45,6 +45,7 @@ export class Level5 extends LevelBase {
}); });
this.A.on("pointerdown", this.onAPointerDown, this); this.A.on("pointerdown", this.onAPointerDown, this);
this.A.on("pointerup", this.onAPointerUp, this);
this.A.on("globalpointermove", this.onAPointerMove, this); this.A.on("globalpointermove", this.onAPointerMove, this);
} }
...@@ -73,6 +74,10 @@ export class Level5 extends LevelBase { ...@@ -73,6 +74,10 @@ export class Level5 extends LevelBase {
pos = null; pos = null;
onAPointerUp(e) {
this.pos = null;
}
onAPointerDown(e) { onAPointerDown(e) {
const { x, y } = e.data.global; const { x, y } = e.data.global;
this.pos = { this.pos = {
......
...@@ -27,6 +27,7 @@ export class Level7 extends LevelBase { ...@@ -27,6 +27,7 @@ export class Level7 extends LevelBase {
.position.set(-203, -108); .position.set(-203, -108);
getApp().stage.on("pointerdown", this.onPointerDown, this); getApp().stage.on("pointerdown", this.onPointerDown, this);
getApp().stage.on("pointerup", this.onPointerUp, this);
getApp().stage.on("pointermove", this.onPointerMove, this); getApp().stage.on("pointermove", this.onPointerMove, this);
} }
...@@ -34,6 +35,7 @@ export class Level7 extends LevelBase { ...@@ -34,6 +35,7 @@ export class Level7 extends LevelBase {
passLevel() { passLevel() {
this.setTouchEnable(false); this.setTouchEnable(false);
getApp().stage.off("pointerdown", this.onPointerDown, this); getApp().stage.off("pointerdown", this.onPointerDown, this);
getApp().stage.off("pointerup", this.onPointerUp, this);
getApp().stage.off("pointermove", this.onPointerMove, this); getApp().stage.off("pointermove", this.onPointerMove, this);
Tween.get(this.pig) Tween.get(this.pig)
.to({ angle: -180, }, 222) .to({ angle: -180, }, 222)
...@@ -55,8 +57,14 @@ export class Level7 extends LevelBase { ...@@ -55,8 +57,14 @@ export class Level7 extends LevelBase {
return Math.atan2(dy, dx) * (180 / Math.PI); return Math.atan2(dy, dx) * (180 / Math.PI);
} }
sAngle = 0; sAngle = null;
onPointerUp(e) {
this.sAngle = null;
}
onPointerMove = (e: any) => { onPointerMove = (e: any) => {
if (this.sAngle === null) return;
const { x, y } = e.data.global; const { x, y } = e.data.global;
const angle = this.calcAngle(x, y); const angle = this.calcAngle(x, y);
this.pig.angle = angle - this.sAngle; this.pig.angle = angle - this.sAngle;
...@@ -68,7 +76,7 @@ export class Level7 extends LevelBase { ...@@ -68,7 +76,7 @@ export class Level7 extends LevelBase {
onPointerDown(e) { onPointerDown(e) {
const { x: sx, y: sy } = e.data.global; const { x: sx, y: sy } = e.data.global;
this.sAngle = this.calcAngle(sx, sy); this.sAngle = this.calcAngle(sx, sy) - this.pig.angle;
} }
onDestroy() { onDestroy() {
...@@ -76,6 +84,7 @@ export class Level7 extends LevelBase { ...@@ -76,6 +84,7 @@ export class Level7 extends LevelBase {
Tween.removeTweens(this.pig); Tween.removeTweens(this.pig);
Tween.removeTweens(this.coin); Tween.removeTweens(this.coin);
getApp().stage.off("pointerdown", this.onPointerDown, this); getApp().stage.off("pointerdown", this.onPointerDown, this);
getApp().stage.off("pointerup", this.onPointerUp, this);
getApp().stage.off("pointermove", this.onPointerMove, this); getApp().stage.off("pointermove", this.onPointerMove, this);
} }
......
...@@ -28,11 +28,16 @@ export class Level9 extends LevelBase { ...@@ -28,11 +28,16 @@ export class Level9 extends LevelBase {
this.right.eventMode = "none"; this.right.eventMode = "none";
this.A.on("pointerdown", this.onAPointerDown, this); this.A.on("pointerdown", this.onAPointerDown, this);
this.A.on("pointerup", this.onAPointerUp, this);
this.A.on("globalpointermove", this.onAPointerMove, this); this.A.on("globalpointermove", this.onAPointerMove, this);
} }
pos = null; pos = null;
onAPointerUp(e) {
this.pos = null;
}
onAPointerDown(e) { onAPointerDown(e) {
const { x, y } = e.data.global; const { x, y } = e.data.global;
this.pos = { this.pos = {
......
...@@ -9,6 +9,7 @@ import { Level9 } from "@/pages/GamePage/Level/Level9.ts"; ...@@ -9,6 +9,7 @@ import { Level9 } from "@/pages/GamePage/Level/Level9.ts";
import { Level10 } from "@/pages/GamePage/Level/Level10.ts"; 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 { Level23 } from "@/pages/GamePage/Level/Level23.ts"; import { Level23 } from "@/pages/GamePage/Level/Level23.ts";
...@@ -30,7 +31,7 @@ export const LevelArr = [ ...@@ -30,7 +31,7 @@ export const LevelArr = [
{ 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: Level14, tip: `移开乌云露出太阳<br/>让冰块融化` }, // 18 { cls: Level18, tip: `移开乌云露出太阳<br/>让冰块融化` }, // 18
{ cls: Level14, tip: `将冰箱放大至能够装下长颈鹿` }, // 19 { cls: Level14, tip: `将冰箱放大至能够装下长颈鹿` }, // 19
{ cls: Level14, tip: `别忘了把题目也装进箱子里` }, // 20 { cls: Level14, tip: `别忘了把题目也装进箱子里` }, // 20
{ cls: Level14, tip: `移动鸡蛋,碰一碰便知` }, // 21 { cls: Level14, tip: `移动鸡蛋,碰一碰便知` }, // 21
......
import sensors from "sa-sdk-javascript/dist/web/sensorsdata.es6"; import sensors from "sa-sdk-javascript/dist/web/sensorsdata.es6.js";
import SMEncryption from "sa-sdk-javascript/dist/web/plugin/sm-encryption/index.es6"; import SMEncryption from "sa-sdk-javascript/dist/web/plugin/sm-encryption/index.es6.js";
import { extranceName, platFormName, platformType } from "./constants.ts"; import { extranceName, platFormName, platformType } from "./constants.ts";
import { GetCurrSkinId } from "./utils"; import { GetCurrSkinId } from "./utils";
import store from "@/store/store.ts"; import store from "@/store/store.ts";
......
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