Commit 9478927f authored by Master Q's avatar Master Q

复活卡天假放练点

parent d2093c22
...@@ -45,5 +45,8 @@ ...@@ -45,5 +45,8 @@
"webpack-cli": "^4.10.0", "webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1", "webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.8.0" "webpack-merge": "^5.8.0"
},
"dependencies": {
"@lightfish/tools": "^1.0.5"
} }
} }
...@@ -716,5 +716,5 @@ export const ResJson = { ...@@ -716,5 +716,5 @@ export const ResJson = {
} }
], ],
// eslint-disable-next-line // eslint-disable-next-line
"path": "https://yun.duiba.com.cn/db_games/activity/template/1670242040/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/template/1670478326/resource/"
} }
\ No newline at end of file
...@@ -21,6 +21,7 @@ import getEnv = FYGE.getEnv; ...@@ -21,6 +21,7 @@ import getEnv = FYGE.getEnv;
export const GDispatcher = new EventDispatcher(); export const GDispatcher = new EventDispatcher();
export const loadAllGroups = async function() { export const loadAllGroups = async function() {
FYGE.setEnv('tb')
RES.loadConfig(ResJson) RES.loadConfig(ResJson)
await RES.loadAllGroup() await RES.loadAllGroup()
} }
......
...@@ -173,8 +173,8 @@ export const ModalCtroller = (function() { ...@@ -173,8 +173,8 @@ export const ModalCtroller = (function() {
ModalMap.set(ModalNode, el) ModalMap.set(ModalNode, el)
el.showModal() el.showModal()
}} }}
closeModal={() => { closeModal={async () => {
ModalCtroller.closeModal(ModalNode) await ModalCtroller.closeModal(ModalNode)
}} }}
></M>) ></M>)
}, },
......
...@@ -25,10 +25,10 @@ export class DrawFailModal extends Dream.RenderContainer { ...@@ -25,10 +25,10 @@ export class DrawFailModal extends Dream.RenderContainer {
<DreamContainer> <DreamContainer>
<DreamSprite src={roleCont} /> <DreamSprite src={roleCont} />
<DreamSprite onClick={this.onConfirm} inlineProps={{ {/* <DreamSprite onClick={this.onConfirm} inlineProps={{
x: roleCont.width - 50, x: roleCont.width - 50,
y: -50 y: -50
}} src={RES.getRes('closebtn.png')}/> }} src={RES.getRes('closebtn.png')}/> */}
<DreamSprite onClick={this.onConfirm} inlineProps={{ <DreamSprite onClick={this.onConfirm} inlineProps={{
x: roleCont.width / 2 - confirmbtn.width / 2, x: roleCont.width / 2 - confirmbtn.width / 2,
y: 300 y: 300
......
...@@ -20,9 +20,9 @@ export class DrawSucModal extends Dream.RenderContainer<{ ...@@ -20,9 +20,9 @@ export class DrawSucModal extends Dream.RenderContainer<{
img: string img: string
}> { }> {
onClose2GameOver = () => { onClose2GameOver = async () => {
await this.props.closeModal()
this.props.onConfirm() this.props.onConfirm()
this.props.closeModal()
} }
onConfirm = () => { onConfirm = () => {
...@@ -42,11 +42,11 @@ export class DrawSucModal extends Dream.RenderContainer<{ ...@@ -42,11 +42,11 @@ export class DrawSucModal extends Dream.RenderContainer<{
<DreamContainer> <DreamContainer>
<DreamSprite src={roleCont}></DreamSprite> <DreamSprite src={roleCont}></DreamSprite>
<DreamSprite onClick={() => { {/* <DreamSprite onClick={() => {
this.onClose2GameOver() this.onClose2GameOver()
}} inlineProps={{ }} inlineProps={{
x: roleWidth - 50 x: roleWidth - 50
}} src={RES.getRes('closebtn.png')}/> }} src={RES.getRes('closebtn.png')}/> */}
<DreamSprite inlineProps={{ <DreamSprite inlineProps={{
x: roleWidth / 2 - 100, x: roleWidth / 2 - 100,
......
import { DreamContainer } from "../../components/DreamContainer/DreamContainer"; import { DreamContainer } from "../../components/DreamContainer/DreamContainer";
import { DreamSprite } from "../../components/DreamSprite/DreamSprite"; import { DreamSprite } from "../../components/DreamSprite/DreamSprite";
import Dream from "../../Dream"; import Dream from "../../Dream";
import { layers } from "../../modules/layers";
import { RES } from "../../modules/RES"; import { RES } from "../../modules/RES";
import { UsePreload } from "../../modules/UseDecorator/usePreload"; import { UsePreload } from "../../modules/UseDecorator/usePreload";
...@@ -15,13 +16,17 @@ export class FinalGiftModal extends Dream.RenderContainer { ...@@ -15,13 +16,17 @@ export class FinalGiftModal extends Dream.RenderContainer {
this.props.onConfirm() this.props.onConfirm()
} }
didRendered(): void {
layers.stage.once(FYGE.MouseEvent.CLICK, this.onConfirm, this)
}
render() { render() {
const roleCont = RES.getRes('FGMB.png') const roleCont = RES.getRes('FGMB.png')
const confirmbtn = RES.getRes('FGM1.png') const confirmbtn = RES.getRes('FGM1.png')
return ( return (
<DreamContainer> <DreamContainer>
<DreamSprite src={roleCont} /> <DreamSprite src={roleCont} />
<DreamSprite src={confirmbtn} onClick={this.onConfirm.bind(this)} inlineProps={{ <DreamSprite src={confirmbtn} inlineProps={{
x: roleCont.width / 2 - confirmbtn.width / 2, x: roleCont.width / 2 - confirmbtn.width / 2,
y: 500 y: 500
}} /> }} />
......
import { throttle } from "@lightfish/tools";
import { DreamContainer } from "../../components/DreamContainer/DreamContainer"; import { DreamContainer } from "../../components/DreamContainer/DreamContainer";
import { DreamSprite } from "../../components/DreamSprite/DreamSprite"; import { DreamSprite } from "../../components/DreamSprite/DreamSprite";
import { DreamTextField } from "../../components/DreamTextField/DreamTextField"; import { DreamTextField } from "../../components/DreamTextField/DreamTextField";
...@@ -24,6 +25,7 @@ export class GameResumeModal extends Dream.RenderContainer<{ ...@@ -24,6 +25,7 @@ export class GameResumeModal extends Dream.RenderContainer<{
didRendered(): void { didRendered(): void {
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
if (this.count == 0) { if (this.count == 0) {
this.props.onCancel()
this.props.closeModal() this.props.closeModal()
clearInterval(this.intervalId) clearInterval(this.intervalId)
return return
...@@ -49,7 +51,7 @@ export class GameResumeModal extends Dream.RenderContainer<{ ...@@ -49,7 +51,7 @@ export class GameResumeModal extends Dream.RenderContainer<{
/** /**
* 确认走复活逻辑 * 确认走复活逻辑
*/ */
onConfirm = async () => { onConfirm = throttle(async () => {
clearInterval(this.intervalId) clearInterval(this.intervalId)
const { const {
...@@ -62,7 +64,7 @@ export class GameResumeModal extends Dream.RenderContainer<{ ...@@ -62,7 +64,7 @@ export class GameResumeModal extends Dream.RenderContainer<{
this.props.closeModal() this.props.closeModal()
} }
} })
render() { render() {
const RoleContBack = RES.getRes('GameResumeModalBack.png') const RoleContBack = RES.getRes('GameResumeModalBack.png')
......
...@@ -23,7 +23,7 @@ export const BoxTypeList: BoxType[] = [ ...@@ -23,7 +23,7 @@ export const BoxTypeList: BoxType[] = [
export const GameConfig = { export const GameConfig = {
debugger: true, debugger: true,
GenerateSpace: [300, 400], // 生成间距 GenerateSpace: [300, 400], // 生成间距
finalGiftPart: 0.1, // 最终奖励 概率 100% finalGiftPart: 1, // 最终奖励 概率 100%
maxLen: 550, maxLen: 550,
totoalPart: 0, // 全部概率 totoalPart: 0, // 全部概率
PartList: [] as { PartList: [] as {
......
...@@ -231,7 +231,8 @@ export class GameScene extends Dream.RenderContainer { ...@@ -231,7 +231,8 @@ export class GameScene extends Dream.RenderContainer {
oz oz
} = this.CurrBoxItem } = this.CurrBoxItem
FYGE.Tween.removeTweens(touchPushObj) FYGE.Tween.removeTweens(touchPushObj)
// Math.abs(this.GameEleStack.stackHead.x - this.CurrBoxItem.x) // TODO TEST
// touchPushObj.tl = Math.random() > 0.5 ? Math.abs(this.GameEleStack.stackHead.x - this.CurrBoxItem.x) : touchPushObj.tl
let tl = Math.abs(PlayerTarget.x + touchPushObj.tl * this.dir - cx) let tl = Math.abs(PlayerTarget.x + touchPushObj.tl * this.dir - cx)
const _i = this.onGetCurrJumpIndex(tl) const _i = this.onGetCurrJumpIndex(tl)
let currTanN = GameConfig.GenerateConfig.tanNum let currTanN = GameConfig.GenerateConfig.tanNum
......
...@@ -940,6 +940,13 @@ ...@@ -940,6 +940,13 @@
"@babel/helper-validator-option" "^7.18.6" "@babel/helper-validator-option" "^7.18.6"
"@babel/plugin-transform-typescript" "^7.18.6" "@babel/plugin-transform-typescript" "^7.18.6"
"@babel/runtime@^7.17.2":
version "7.20.6"
resolved "http://npm.dui88.com:80/@babel%2fruntime/-/runtime-7.20.6.tgz#facf4879bfed9b5326326273a64220f099b0fce3"
integrity sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==
dependencies:
regenerator-runtime "^0.13.11"
"@babel/runtime@^7.8.4": "@babel/runtime@^7.8.4":
version "7.19.0" version "7.19.0"
resolved "http://npm.dui88.com:80/@babel%2fruntime/-/runtime-7.19.0.tgz#22b11c037b094d27a8a2504ea4dcff00f50e2259" resolved "http://npm.dui88.com:80/@babel%2fruntime/-/runtime-7.19.0.tgz#22b11c037b094d27a8a2504ea4dcff00f50e2259"
...@@ -1039,6 +1046,13 @@ ...@@ -1039,6 +1046,13 @@
resolved "http://npm.dui88.com:80/@leichtgewicht%2fip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" resolved "http://npm.dui88.com:80/@leichtgewicht%2fip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b"
integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==
"@lightfish/tools@^1.0.5":
version "1.0.5"
resolved "http://npm.dui88.com:80/@lightfish%2ftools/-/tools-1.0.5.tgz#96aedb363d6b8a9d83fa6ae4d6d8a2fd4bc06582"
integrity sha512-APtNnurmB3jzWwFnYrb3uK9UppFjPTmOEowNMd+P6R4vadr/V2QNX+Xd/Wl/17dAkswnplLzsphXHtoeiIXX8g==
dependencies:
"@babel/runtime" "^7.17.2"
"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3":
version "2.1.8-no-fsevents.3" version "2.1.8-no-fsevents.3"
resolved "http://npm.dui88.com:80/@nicolo-ribaudo%2fchokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" resolved "http://npm.dui88.com:80/@nicolo-ribaudo%2fchokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b"
...@@ -3414,6 +3428,11 @@ regenerate@^1.4.2: ...@@ -3414,6 +3428,11 @@ regenerate@^1.4.2:
resolved "http://npm.dui88.com:80/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" resolved "http://npm.dui88.com:80/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a"
integrity sha1-uTRtiCfo9aMve6KWN9OYtpAUhIo= integrity sha1-uTRtiCfo9aMve6KWN9OYtpAUhIo=
regenerator-runtime@^0.13.11:
version "0.13.11"
resolved "http://npm.dui88.com:80/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
regenerator-runtime@^0.13.4: regenerator-runtime@^0.13.4:
version "0.13.9" version "0.13.9"
resolved "http://npm.dui88.com:80/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" resolved "http://npm.dui88.com:80/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"
......
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