Commit 18dd1f4c authored by Master Q's avatar Master Q

Finished

parent 9478927f
......@@ -46,7 +46,5 @@
"webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.8.0"
},
"dependencies": {
"@lightfish/tools": "^1.0.5"
}
"dependencies": {}
}
......@@ -2,709 +2,63 @@ export const ResJson = {
"groups": [
{
"keys": "box1.png,box2.png,box3.png,box4.png,box5.png,box6.png,box7.png,box8.png",
"name": "Boxes",
"atlas": {
"box7.png": {
"x": 2,
"y": 2,
"w": 233,
"h": 442,
"ox": 26,
"oy": 7,
"sw": 283,
"sh": 449,
"ro": false
},
"box8.png": {
"x": 237,
"y": 2,
"w": 184,
"h": 429,
"ox": 50,
"oy": 20,
"sw": 283,
"sh": 449,
"ro": false
},
"box3.png": {
"x": 423,
"y": 2,
"w": 225,
"h": 284,
"ox": 29,
"oy": 44,
"sw": 283,
"sh": 328,
"ro": false
},
"box2.png": {
"x": 2,
"y": 446,
"w": 280,
"h": 204,
"ox": 0,
"oy": 91,
"sw": 283,
"sh": 328,
"ro": false
},
"box4.png": {
"x": 284,
"y": 433,
"w": 184,
"h": 276,
"ox": 50,
"oy": 52,
"sw": 283,
"sh": 328,
"ro": true
},
"box6.png": {
"x": 650,
"y": 2,
"w": 255,
"h": 221,
"ox": 14,
"oy": 95,
"sw": 283,
"sh": 328,
"ro": true
},
"box1.png": {
"x": 650,
"y": 259,
"w": 228,
"h": 214,
"ox": 28,
"oy": 92,
"sw": 283,
"sh": 328,
"ro": true
},
"box5.png": {
"x": 423,
"y": 288,
"w": 224,
"h": 142,
"ox": 30,
"oy": 151,
"sw": 283,
"sh": 328,
"ro": false
}
}
"name": "Boxes"
},
{
"keys": "DFM1.png,DFMB.png",
"name": "DrawFailModal",
"atlas": {
"DFMB.png": {
"x": 2,
"y": 2,
"w": 541,
"h": 467,
"ox": 0,
"oy": 0,
"sw": 541,
"sh": 467,
"ro": false
},
"DFM1.png": {
"x": 2,
"y": 471,
"w": 369,
"h": 97,
"ox": 0,
"oy": 0,
"sw": 369,
"sh": 97,
"ro": false
}
}
"name": "DrawFailModal"
},
{
"keys": "DSM1.png,DSMB.png",
"name": "DrawSucModal",
"atlas": {
"DSMB.png": {
"x": 2,
"y": 2,
"w": 576,
"h": 747,
"ox": 0,
"oy": 0,
"sw": 576,
"sh": 747,
"ro": false
},
"DSM1.png": {
"x": 580,
"y": 2,
"w": 369,
"h": 97,
"ox": 0,
"oy": 0,
"sw": 369,
"sh": 97,
"ro": true
}
}
"name": "DrawSucModal"
},
{
"keys": "FGM1.png,FGMB.png",
"name": "FinalGiftModal",
"atlas": {
"FGMB.png": {
"x": 2,
"y": 2,
"w": 503,
"h": 571,
"ox": 0,
"oy": 0,
"sw": 503,
"sh": 571,
"ro": false
},
"FGM1.png": {
"x": 507,
"y": 2,
"w": 369,
"h": 97,
"ox": 0,
"oy": 0,
"sw": 369,
"sh": 97,
"ro": true
}
}
"name": "FinalGiftModal"
},
{
"keys": "2b727ace1b5c959dbc6274cacb5b4e5f.png,3ed4431aad269ef7059929043bd45597.png,60377934f7cf618b52457273db65aace.png,9074d1305c0e7feb16037261986c7f4b.png,f3bde4659477f82338fcb2b134272321.png",
"name": "GameAtom",
"atlas": {
"f3bde4659477f82338fcb2b134272321.png": {
"x": 2,
"y": 2,
"w": 26,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 26,
"sh": 26,
"ro": false
},
"3ed4431aad269ef7059929043bd45597.png": {
"x": 30,
"y": 2,
"w": 19,
"h": 19,
"ox": 0,
"oy": 0,
"sw": 19,
"sh": 19,
"ro": false
},
"60377934f7cf618b52457273db65aace.png": {
"x": 30,
"y": 23,
"w": 19,
"h": 18,
"ox": 0,
"oy": 0,
"sw": 19,
"sh": 18,
"ro": false
},
"2b727ace1b5c959dbc6274cacb5b4e5f.png": {
"x": 2,
"y": 30,
"w": 12,
"h": 11,
"ox": 0,
"oy": 0,
"sw": 12,
"sh": 11,
"ro": true
},
"9074d1305c0e7feb16037261986c7f4b.png": {
"x": 15,
"y": 30,
"w": 7,
"h": 7,
"ox": 0,
"oy": 0,
"sw": 7,
"sh": 7,
"ro": false
}
}
"name": "GameAtom"
},
{
"keys": "GOM0.png,GOM1.png,GameOverModalBack.png",
"name": "GameOverModal",
"atlas": {
"GameOverModalBack.png": {
"x": 2,
"y": 2,
"w": 576,
"h": 739,
"ox": 0,
"oy": 0,
"sw": 576,
"sh": 739,
"ro": false
},
"GOM1.png": {
"x": 580,
"y": 2,
"w": 369,
"h": 97,
"ox": 0,
"oy": 0,
"sw": 369,
"sh": 97,
"ro": true
},
"GOM0.png": {
"x": 580,
"y": 373,
"w": 163,
"h": 50,
"ox": 0,
"oy": 0,
"sw": 163,
"sh": 50,
"ro": true
}
}
"name": "GameOverModal"
},
{
"keys": "GQM0.png,GQM1.png,GQMB.png",
"name": "GameQuitModal",
"atlas": {
"GQMB.png": {
"x": 2,
"y": 2,
"w": 601,
"h": 467,
"ox": 0,
"oy": 0,
"sw": 601,
"sh": 467,
"ro": false
},
"GQM1.png": {
"x": 2,
"y": 471,
"w": 249,
"h": 97,
"ox": 0,
"oy": 0,
"sw": 249,
"sh": 97,
"ro": false
},
"GQM0.png": {
"x": 253,
"y": 471,
"w": 231,
"h": 91,
"ox": 0,
"oy": 0,
"sw": 231,
"sh": 91,
"ro": false
}
}
"name": "GameQuitModal"
},
{
"keys": "GameResumeModalBack.png,cancelBtn.png,useRightNowBtn.png",
"name": "GameResumeModal",
"atlas": {
"GameResumeModalBack.png": {
"x": 2,
"y": 2,
"w": 601,
"h": 547,
"ox": 0,
"oy": 0,
"sw": 601,
"sh": 547,
"ro": false
},
"useRightNowBtn.png": {
"x": 2,
"y": 551,
"w": 369,
"h": 97,
"ox": 0,
"oy": 0,
"sw": 369,
"sh": 97,
"ro": false
},
"cancelBtn.png": {
"x": 373,
"y": 551,
"w": 230,
"h": 66,
"ox": 0,
"oy": 0,
"sw": 230,
"sh": 66,
"ro": false
}
}
"name": "GameResumeModal"
},
{
"keys": "back.png,bottomAtom.png,gele1.png,goBackBtn.png,player.png,scoreboard-t.png",
"name": "GameScene",
"atlas": {
"back.png": {
"x": 2,
"y": 2,
"w": 750,
"h": 1624,
"ox": 0,
"oy": 0,
"sw": 750,
"sh": 1624,
"ro": false
},
"bottomAtom.png": {
"x": 754,
"y": 2,
"w": 750,
"h": 340,
"ox": 0,
"oy": 0,
"sw": 750,
"sh": 340,
"ro": true
},
"gele1.png": {
"x": 754,
"y": 754,
"w": 279,
"h": 204,
"ox": 0,
"oy": 0,
"sw": 279,
"sh": 204,
"ro": false
},
"player.png": {
"x": 754,
"y": 960,
"w": 132,
"h": 201,
"ox": 0,
"oy": 0,
"sw": 132,
"sh": 201,
"ro": true
},
"goBackBtn.png": {
"x": 957,
"y": 960,
"w": 138,
"h": 68,
"ox": 0,
"oy": 0,
"sw": 138,
"sh": 68,
"ro": true
},
"scoreboard-t.png": {
"x": 1035,
"y": 754,
"w": 86,
"h": 38,
"ox": 0,
"oy": 0,
"sw": 86,
"sh": 38,
"ro": true
}
}
"name": "GameScene"
},
{
"keys": "2120075482341d7d94d8164b1a0f6d43.png,3ed4431aad269ef7059929043bd45597.png,4f4612689c9fde32a8c28c129e9f6e7d.png,60377934f7cf618b52457273db65aace.png,63b0a84f0f9b10842b5f83fa5e923534.png,f3bde4659477f82338fcb2b134272321.png",
"name": "JumpEnd",
"atlas": {
"2120075482341d7d94d8164b1a0f6d43.png": {
"x": 2,
"y": 2,
"w": 274,
"h": 294,
"ox": 25,
"oy": 21,
"sw": 323,
"sh": 323,
"ro": false
},
"f3bde4659477f82338fcb2b134272321.png": {
"x": 278,
"y": 2,
"w": 26,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 26,
"sh": 26,
"ro": false
},
"4f4612689c9fde32a8c28c129e9f6e7d.png": {
"x": 278,
"y": 30,
"w": 25,
"h": 25,
"ox": 0,
"oy": 0,
"sw": 25,
"sh": 25,
"ro": false
},
"63b0a84f0f9b10842b5f83fa5e923534.png": {
"x": 278,
"y": 57,
"w": 25,
"h": 25,
"ox": 0,
"oy": 0,
"sw": 25,
"sh": 25,
"ro": false
},
"3ed4431aad269ef7059929043bd45597.png": {
"x": 278,
"y": 84,
"w": 19,
"h": 19,
"ox": 0,
"oy": 0,
"sw": 19,
"sh": 19,
"ro": false
},
"60377934f7cf618b52457273db65aace.png": {
"x": 278,
"y": 105,
"w": 19,
"h": 18,
"ox": 0,
"oy": 0,
"sw": 19,
"sh": 18,
"ro": false
}
}
"name": "JumpEnd"
},
{
"keys": "Guide1.png,NGSB.jpg,nextStep.png,startGameBtn.png",
"name": "NewGuyScene",
"atlas": {
"Guide1.png": {
"x": 2,
"y": 2,
"w": 750,
"h": 1624,
"ox": 0,
"oy": 0,
"sw": 750,
"sh": 1624,
"ro": false
},
"nextStep.png": {
"x": 754,
"y": 2,
"w": 203,
"h": 60,
"ox": 0,
"oy": 0,
"sw": 203,
"sh": 60,
"ro": true
},
"startGameBtn.png": {
"x": 754,
"y": 207,
"w": 203,
"h": 60,
"ox": 0,
"oy": 0,
"sw": 203,
"sh": 60,
"ro": true
}
}
"name": "NewGuyScene"
},
{
"keys": "2120075482341d7d94d8164b1a0f6d43.png",
"name": "PerfectJumpEnd",
"atlas": {
"2120075482341d7d94d8164b1a0f6d43.png": {
"x": 2,
"y": 2,
"w": 274,
"h": 294,
"ox": 25,
"oy": 21,
"sw": 323,
"sh": 323,
"ro": false
}
}
"name": "PerfectJumpEnd"
},
{
"keys": "closebtn.png,giftBoxIcon.png,waitingBg.png,waitingRot.png",
"name": "common",
"atlas": {
"waitingBg.png": {
"x": 2,
"y": 2,
"w": 160,
"h": 180,
"ox": 0,
"oy": 0,
"sw": 160,
"sh": 180,
"ro": false
},
"giftBoxIcon.png": {
"x": 164,
"y": 2,
"w": 127,
"h": 125,
"ox": 0,
"oy": 0,
"sw": 127,
"sh": 125,
"ro": true
},
"waitingRot.png": {
"x": 2,
"y": 184,
"w": 56,
"h": 56,
"ox": 0,
"oy": 0,
"sw": 56,
"sh": 56,
"ro": false
},
"closebtn.png": {
"x": 60,
"y": 184,
"w": 52,
"h": 52,
"ox": 0,
"oy": 0,
"sw": 52,
"sh": 52,
"ro": false
}
}
"name": "common"
},
{
"keys": "786bf3500cf0986c9678f6b8a8cf24f6.png,b5d5c1070b13deb0230b0efe5c58ee9d.png,ca7b2a497afc6147cc076d55600154bd.png,d64a974a921d32ed81463c918bae137e.png,f49a78c8287be1a92ee75ce3a2b7a512.png",
"name": "countDown",
"atlas": {
"ca7b2a497afc6147cc076d55600154bd.png": {
"x": 2,
"y": 2,
"w": 109,
"h": 175,
"ox": 0,
"oy": 0,
"sw": 109,
"sh": 175,
"ro": false
},
"786bf3500cf0986c9678f6b8a8cf24f6.png": {
"x": 113,
"y": 2,
"w": 98,
"h": 172,
"ox": 0,
"oy": 0,
"sw": 98,
"sh": 172,
"ro": false
},
"d64a974a921d32ed81463c918bae137e.png": {
"x": 2,
"y": 179,
"w": 110,
"h": 172,
"ox": 0,
"oy": 0,
"sw": 110,
"sh": 172,
"ro": true
},
"f49a78c8287be1a92ee75ce3a2b7a512.png": {
"x": 213,
"y": 2,
"w": 104,
"h": 105,
"ox": 0,
"oy": 0,
"sw": 104,
"sh": 105,
"ro": false
},
"b5d5c1070b13deb0230b0efe5c58ee9d.png": {
"x": 213,
"y": 109,
"w": 53,
"h": 53,
"ox": 0,
"oy": 0,
"sw": 53,
"sh": 53,
"ro": false
}
}
"name": "countDown"
},
{
"keys": "548342251013e2f832a40380d1855bf5.png,af75d547153d9118b05d4dd8fbcfe022.png,fd0f936244fb973bddf520819997f5ba.png",
"name": "handLottie",
"atlas": {
"fd0f936244fb973bddf520819997f5ba.png": {
"x": 2,
"y": 2,
"w": 120,
"h": 87,
"ox": 0,
"oy": 0,
"sw": 120,
"sh": 87,
"ro": false
},
"af75d547153d9118b05d4dd8fbcfe022.png": {
"x": 2,
"y": 91,
"w": 92,
"h": 92,
"ox": 0,
"oy": 0,
"sw": 92,
"sh": 92,
"ro": false
},
"548342251013e2f832a40380d1855bf5.png": {
"x": 124,
"y": 2,
"w": 46,
"h": 46,
"ox": 0,
"oy": 0,
"sw": 46,
"sh": 46,
"ro": false
}
}
"name": "handLottie"
},
{
"keys": "nx1.jpg,ny1.jpg,nz1.jpg,px1.jpg,py1.jpg,pz1.jpg",
......@@ -715,6 +69,5 @@ export const ResJson = {
"name": "spine"
}
],
// eslint-disable-next-line
"path": "https://yun.duiba.com.cn/db_games/activity/template/1670478326/resource/"
"path": "./resource/"
}
\ No newline at end of file
......@@ -18,7 +18,7 @@ const defaultConfig: UsePreloadType = {
resPreloadFunc: {
others: RES.getResAsync
},
loadingComponent: DreamDotAni,
loadingComponent: function() {return new FYGE.Container()},
preAction: () => Promise.resolve()
}
......
import { throttle } from "@lightfish/tools";
import { DreamContainer } from "../../components/DreamContainer/DreamContainer";
import { DreamSprite } from "../../components/DreamSprite/DreamSprite";
import { DreamTextField } from "../../components/DreamTextField/DreamTextField";
......@@ -7,6 +6,7 @@ import { DreamSpriteV2 } from "../../Dream/UI";
import { RES } from "../../modules/RES";
import { UsePreload } from "../../modules/UseDecorator/usePreload";
import { sendTbNet, TbNetName } from "../../tools/TbNet";
import { throttle } from "../../tools/Tools";
@UsePreload({
preAction: async function() {
......
......@@ -21,9 +21,9 @@ export const BoxTypeList: BoxType[] = [
]
export const GameConfig = {
debugger: true,
debugger: false,
GenerateSpace: [300, 400], // 生成间距
finalGiftPart: 1, // 最终奖励 概率 100%
finalGiftPart: 0.1, // 最终奖励 概率 100%
maxLen: 550,
totoalPart: 0, // 全部概率
PartList: [] as {
......
......@@ -6,4 +6,110 @@ export class Tools {
isFirstGame: false,
liveCard: 1
}
}
\ No newline at end of file
}
/**
* 函数防抖,如下拉菜单
* @param {Function} fn
* @param {Number} delay
* @returns
*/
export function debounce(fn: Function, delay: number=2000) {
let timer:any = null;
function invokeFunc(...args: any[]) {
let context = this;
if(timer) clearTimeout(timer)
timer = setTimeout(()=>{
fn.apply(context, args)
}, delay)
}
function cancel() {
if (timer !== undefined) {
clearTimeout(timer)
}
}
invokeFunc.cancel = cancel
return invokeFunc
}
/**
* 函数防抖的 装饰器版本
* @param time
* @returns
*/
export function debounceDecorator(time: number = 1000) {
return function (target: any, property: string, descriptor: PropertyDescriptor) {
const func = descriptor.value
if (typeof func !== 'function') {
throw new Error('debounceDecorator error: are u kidding me ?')
}
let timerId: any
function invokeFunc(...args: any[]) {
let context = this;
if(timerId) clearTimeout(timerId)
timerId = setTimeout(()=>{
func.apply(context, args)
}, time)
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId)
}
}
invokeFunc.cancel = cancel
descriptor.value = invokeFunc
}
}
/**
* 函数节流, 用作防连点
* @param {Function} fn
* @param {Number} delay
* @returns
*/
export function throttle(fn: Function, delay: number=2000) {
let flag: boolean = true,
timerId: any
return function (...args: any[]) {
if (!flag) return
flag = false
timerId && clearTimeout(timerId)
timerId = setTimeout(function() {
flag = true
}, delay)
const context = this
return fn.apply(context, args)
};
}
/**
* 函数节流的 装饰器版本
* @param time
* @returns
*/
export function throttleDecorator(time: number = 1000) {
return function(target: any, property: string, descriptor: PropertyDescriptor) {
const func: Function = descriptor.value
if (typeof func !== 'function') {
throw new Error('debounceDecorator error: are u kidding me ?')
}
let flag: boolean = true,
timerId: any
function invokeFunc(...args: any[]) {
if (!flag) return
flag = false
timerId && clearTimeout(timerId)
timerId = setTimeout(function() {
flag = true
}, time)
const context = this
return func.apply(context, args)
}
descriptor.value = invokeFunc
}
}
......@@ -940,13 +940,6 @@
"@babel/helper-validator-option" "^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":
version "7.19.0"
resolved "http://npm.dui88.com:80/@babel%2fruntime/-/runtime-7.19.0.tgz#22b11c037b094d27a8a2504ea4dcff00f50e2259"
......@@ -1046,13 +1039,6 @@
resolved "http://npm.dui88.com:80/@leichtgewicht%2fip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b"
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":
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"
......@@ -3428,11 +3414,6 @@ regenerate@^1.4.2:
resolved "http://npm.dui88.com:80/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a"
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:
version "0.13.9"
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