Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MingSnake_241120
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
MingSnake_241120
Commits
1cda4f1d
Commit
1cda4f1d
authored
Nov 26, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
a1a04361
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
375 additions
and
197 deletions
+375
-197
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+142
-61
GameMgr.ts
assets/Scripts/GameMgr.ts
+0
-71
HomeScene.ts
assets/Scripts/Scenes/HomeScene.ts
+2
-0
Enums.ts
assets/Scripts/Scenes/MainGame/Common/Enums.ts
+0
-13
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+1
-21
WebNet.ts
assets/Scripts/Utils/WebNet/WebNet.ts
+14
-3
gameStore.ts
assets/Scripts/store/gameStore.ts
+120
-0
gameStore.ts.meta
assets/Scripts/store/gameStore.ts.meta
+1
-1
store.ts
assets/Scripts/store/store.ts
+0
-20
Start.ts
assets/Start/Start.ts
+3
-0
coop_frontVariable.query.json
preview-template/mock/coop_frontVariable.query.json
+0
-0
start.do.json
preview-template/mock/game/start.do.json
+0
-6
startGame.do.json
preview-template/mock/game/startGame.do.json
+6
-0
startGame数据生成.mjs
preview-template/mock/game/startGame数据生成.mjs
+85
-0
projectRule.query.json
preview-template/mock/projectRule.query.json
+0
-0
records.query.json
preview-template/mock/records.query.json
+0
-0
project.json
settings/v2/packages/project.json
+1
-1
No files found.
assets/Bundles/MainGame/MainGame.scene
View file @
1cda4f1d
...
...
@@ -26,7 +26,7 @@
"_active": true,
"_components": [],
"_prefab": {
"__id__": 1
19
"__id__": 1
26
},
"_lpos": {
"__type__": "cc.Vec3",
...
...
@@ -57,7 +57,7 @@
},
"autoReleaseAssets": false,
"_globals": {
"__id__": 1
23
"__id__": 1
30
},
"_id": "53947ca7-3484-4b53-800d-509405063d68"
},
...
...
@@ -92,16 +92,16 @@
"_active": true,
"_components": [
{
"__id__": 1
15
"__id__": 1
22
},
{
"__id__": 1
16
"__id__": 1
23
},
{
"__id__": 1
17
"__id__": 1
24
},
{
"__id__": 1
18
"__id__": 1
25
}
],
"_prefab": null,
...
...
@@ -193,7 +193,7 @@
"_priority": 40000,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 5
05.24444444444447
,
"_orthoHeight": 5
82.5777777777778
,
"_near": 0,
"_far": 2000,
"_color": {
...
...
@@ -1803,10 +1803,10 @@
"_enabled": true,
"__prefab": null,
"handle": {
"__id__": 1
09
"__id__": 1
16
},
"bg": {
"__id__": 1
13
"__id__": 1
20
},
"normalSp": {
"__uuid__": "7f413237-4b73-4bae-bca7-7ab9e9742ebc@f9941",
...
...
@@ -1828,22 +1828,22 @@
},
"_children": [
{
"__id__": 1
09
"__id__": 1
16
}
],
"_active": true,
"_components": [
{
"__id__": 11
2
"__id__": 11
9
},
{
"__id__": 1
13
"__id__": 1
20
},
{
"__id__": 51
},
{
"__id__": 1
14
"__id__": 1
21
}
],
"_prefab": null,
...
...
@@ -1904,19 +1904,19 @@
"__id__": 87
},
{
"__id__":
99
"__id__":
106
}
],
"_active": true,
"_components": [
{
"__id__": 1
06
"__id__": 1
13
},
{
"__id__": 1
07
"__id__": 1
14
},
{
"__id__": 1
08
"__id__": 1
15
}
],
"_prefab": null,
...
...
@@ -2008,7 +2008,7 @@
"_priority": 50000,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 5
05.24444444444447
,
"_orthoHeight": 5
82.5777777777778
,
"_near": 1,
"_far": 2000,
"_color": {
...
...
@@ -2486,7 +2486,7 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 9
9.56
,
"x": 9
4.55999755859375
,
"y": 0,
"z": 0
},
...
...
@@ -2525,8 +2525,8 @@
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 9
9.56
,
"height":
62
"width": 9
4.55999755859375
,
"height":
75.6
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -2571,11 +2571,11 @@
"_isSystemFontUsed": false,
"_spacingX": 0,
"_isItalic": false,
"_isBold":
fals
e,
"_isBold":
tru
e,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode":
2
,
"_enableOutline":
tru
e,
"_cacheMode":
1
,
"_enableOutline":
fals
e,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
...
...
@@ -2625,7 +2625,7 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 10
7.56
,
"x": 10
2.55999755859375
,
"y": 0,
"z": 0
},
...
...
@@ -2902,8 +2902,8 @@
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 1
4.1
7,
"height": 2
3
"width": 1
2.6
7,
"height": 2
2
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -2952,7 +2952,7 @@
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 2,
"_enableOutline":
tru
e,
"_enableOutline":
fals
e,
"_outlineColor": {
"__type__": "cc.Color",
"r": 255,
...
...
@@ -2989,7 +2989,7 @@
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 6
3.1
7,
"width": 6
1.6
7,
"height": 27.72
},
"_anchorPoint": {
...
...
@@ -3200,7 +3200,7 @@
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width":
204.83999877929688
,
"width":
199.83999633789062
,
"height": 75.6
},
"_anchorPoint": {
...
...
@@ -3288,13 +3288,13 @@
"_active": true,
"_components": [
{
"__id__":
96
"__id__":
103
},
{
"__id__":
97
"__id__":
104
},
{
"__id__":
98
"__id__":
105
}
],
"_prefab": null,
...
...
@@ -3372,6 +3372,21 @@
},
{
"__id__": 95
},
{
"__id__": 96
},
{
"__id__": 98
},
{
"__id__": 100
},
{
"__id__": 101
},
{
"__id__": 102
}
],
"removedComponents": []
...
...
@@ -3438,6 +3453,72 @@
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 97
},
"propertyPath": [
"_enableOutline"
],
"value": false
},
{
"__type__": "cc.TargetInfo",
"localID": [
"83JFgtWhhPp65JtsWzacKf"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 99
},
"propertyPath": [
"_contentSize"
],
"value": {
"__type__": "cc.Size",
"width": 8.271987915039062,
"height": 27.72
}
},
{
"__type__": "cc.TargetInfo",
"localID": [
"8bUrMCxWlMTLSd91dV1ErQ"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 97
},
"propertyPath": [
"_isItalic"
],
"value": false
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 97
},
"propertyPath": [
"_isBold"
],
"value": true
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 97
},
"propertyPath": [
"_cacheMode"
],
"value": 1
},
{
"__type__": "cc.UITransform",
"_name": "",
...
...
@@ -3523,19 +3604,19 @@
},
"_children": [
{
"__id__": 10
0
"__id__": 10
7
}
],
"_active": true,
"_components": [
{
"__id__": 1
03
"__id__": 1
10
},
{
"__id__": 1
04
"__id__": 1
11
},
{
"__id__": 1
05
"__id__": 1
12
}
],
"_prefab": null,
...
...
@@ -3574,16 +3655,16 @@
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__":
99
"__id__":
106
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
1
"__id__": 10
8
},
{
"__id__": 10
2
"__id__": 10
9
}
],
"_prefab": null,
...
...
@@ -3622,7 +3703,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 10
0
"__id__": 10
7
},
"_enabled": true,
"__prefab": null,
...
...
@@ -3644,7 +3725,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 10
0
"__id__": 10
7
},
"_enabled": true,
"__prefab": null,
...
...
@@ -3709,7 +3790,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
99
"__id__":
106
},
"_enabled": true,
"__prefab": null,
...
...
@@ -3731,7 +3812,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
99
"__id__":
106
},
"_enabled": true,
"__prefab": null,
...
...
@@ -3770,7 +3851,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
99
"__id__":
106
},
"_enabled": true,
"__prefab": null,
...
...
@@ -3874,10 +3955,10 @@
"_active": true,
"_components": [
{
"__id__": 11
0
"__id__": 11
7
},
{
"__id__": 11
1
"__id__": 11
8
}
],
"_prefab": null,
...
...
@@ -3916,7 +3997,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
09
"__id__": 1
16
},
"_enabled": true,
"__prefab": null,
...
...
@@ -3938,7 +4019,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
09
"__id__": 1
16
},
"_enabled": true,
"__prefab": null,
...
...
@@ -4174,7 +4255,7 @@
"__id__": 77
},
"luckyNum": {
"__id__": 10
2
"__id__": 10
9
},
"_id": "212vDeP7dNBZXi0fJjPuCy"
},
...
...
@@ -4186,7 +4267,7 @@
"instance": null,
"targetOverrides": [
{
"__id__": 12
0
"__id__": 12
7
}
],
"nestedPrefabInstanceRoots": [
...
...
@@ -4204,7 +4285,7 @@
"__id__": 39
},
"sourceInfo": {
"__id__": 12
1
"__id__": 12
8
},
"propertyPath": [
"head"
...
...
@@ -4213,7 +4294,7 @@
"__id__": 39
},
"targetInfo": {
"__id__": 12
2
"__id__": 12
9
}
},
{
...
...
@@ -4231,28 +4312,28 @@
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__": 1
24
"__id__": 1
31
},
"shadows": {
"__id__": 1
25
"__id__": 1
32
},
"_skybox": {
"__id__": 1
26
"__id__": 1
33
},
"fog": {
"__id__": 1
27
"__id__": 1
34
},
"octree": {
"__id__": 1
28
"__id__": 1
35
},
"skin": {
"__id__": 1
29
"__id__": 1
36
},
"lightProbeInfo": {
"__id__": 13
0
"__id__": 13
7
},
"postSettings": {
"__id__": 13
1
"__id__": 13
8
},
"bakedWithStationaryMainLight": false,
"bakedWithHighpLightmap": false
...
...
assets/Scripts/GameMgr.ts
deleted
100644 → 0
View file @
a1a04361
import
{
sendWebNet
,
WebNetName
}
from
"./Utils/WebNet/WebNet"
;
import
{
changeScene
,
hideWaiting
,
showPanel
,
showToast
,
showWaiting
}
from
"db://assets/Module/UIFast"
;
import
{
AESDecrypt
,
AESEncrypt
}
from
"./Utils/Crypto"
;
import
store
from
"./store/store"
;
import
{
HomeScene
}
from
"./Scenes/HomeScene"
;
export
default
class
GameMgr
{
private
static
_ins
:
GameMgr
=
null
;
public
static
get
ins
()
{
!
GameMgr
.
_ins
&&
(
GameMgr
.
_ins
=
new
GameMgr
());
return
GameMgr
.
_ins
;
}
gameInfo
:
{
recordId
:
number
,
}
=
{
recordId
:
0
,
};
/**
* 开始游戏
*/
async
start
()
{
showWaiting
();
const
{
success
,
data
,
code
}
=
await
sendWebNet
(
WebNetName
.
start
);
hideWaiting
();
const
decrypt
=
JSON
.
parse
(
AESDecrypt
(
data
,
"FDF817451A60EB6F"
,
"cDOiBC1n2QrkAY2P"
));
const
{
recordId
}
=
decrypt
;
this
.
gameInfo
=
{
recordId
,
}
return
true
;
}
/**
* 提交游戏结果
*/
async
submit
(
score
:
number
)
{
showWaiting
();
const
params
=
{
recordId
:
this
.
gameInfo
.
recordId
,
score
:
score
,
level
:
1
,
timestamp
:
Date
.
now
(),
}
const
encrypt
=
AESEncrypt
(
JSON
.
stringify
(
params
),
"FDF817451A60EB6F"
,
"cDOiBC1n2QrkAY2P"
);
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
submit
,
{
encryptedData
:
encrypt
,
},
{
// isGet: false,
});
hideWaiting
();
if
(
!
success
)
{
changeScene
(
HomeScene
);
return
false
;
}
}
}
assets/Scripts/Scenes/HomeScene.ts
View file @
1cda4f1d
...
...
@@ -7,6 +7,7 @@ import { observer, render } from "../store/decorators";
import
{
_asyncThrottle
}
from
"../Utils/Utils"
;
import
RankPanel
from
"../Panels/RankPanel"
;
import
{
UIMgr
}
from
"../../Module/UIMgr"
;
import
gameStore
from
"../store/gameStore"
;
const
{
ccclass
,
property
}
=
_decorator
;
...
...
@@ -45,6 +46,7 @@ export class HomeScene extends Scene {
}
clickStart
=
_asyncThrottle
(
async
()
=>
{
await
gameStore
.
startGame
();
changeScene
(
MainGame
);
});
...
...
assets/Scripts/Scenes/MainGame/Common/Enums.ts
View file @
1cda4f1d
...
...
@@ -15,7 +15,6 @@ export enum FoodType {
ccenum
(
FoodType
);
// 移动方向枚举
export
enum
DirectionType
{
DEFAULT
=
0
,
// 默认方向
...
...
@@ -29,18 +28,6 @@ export enum GameState {
PLAY
=
1
,
// 游戏中
PAUSE
=
2
,
// 暂停
OVER
=
3
,
// 游戏结束
WIN
=
4
,
// 游戏胜利
QUIT
=
5
// 退出游戏
}
export
enum
FlagType
{
SHIELD
=
0
,
MAGNET
=
1
,
SPEED_UP
=
2
,
DOUBLE_SCORE
=
3
}
export
enum
EBodyTag
{
Player
}
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
1cda4f1d
...
...
@@ -76,9 +76,7 @@ export class MainGame extends Scene {
return
this
.
_killNum
;
}
private
state
:
GameState
=
GameState
.
READY
;
private
rebirthSum
:
number
=
0
;
private
static
_ins
:
MainGame
=
null
;
static
get
ins
():
MainGame
{
...
...
@@ -191,35 +189,17 @@ export class MainGame extends Scene {
// }
// }
onPause
()
{
this
.
setGameState
(
GameState
.
PAUSE
);
console
.
log
(
"pause"
);
}
setGameState
(
state
:
GameState
)
{
this
.
state
=
Number
(
state
);
switch
(
this
.
state
)
{
case
GameState
.
READY
:
break
;
case
GameState
.
PLAY
:
director
.
resume
();
break
;
case
GameState
.
PAUSE
:
director
.
pause
();
break
;
case
GameState
.
OVER
:
this
.
rebirthSum
++
;
if
(
this
.
rebirthSum
>
2
)
return
this
.
showGOver
();
this
.
showGOver
();
showToast
(
"你已死亡!"
);
break
;
case
GameState
.
WIN
:
director
.
pause
();
console
.
log
(
"win"
,
this
.
player
.
getSnakeLen
());
break
;
case
GameState
.
QUIT
:
director
.
resume
();
director
.
loadScene
(
"GameMain"
);
break
;
default
:
console
.
log
(
"err"
);
}
...
...
assets/Scripts/Utils/WebNet/WebNet.ts
View file @
1cda4f1d
...
...
@@ -20,6 +20,12 @@ export enum WebNetName {
getFrontVariable
=
'coop_frontVariable.query'
,
buriedPoint
=
'buriedPoint'
,
startGame
=
"game/startGame.do"
,
submitOne
=
"game/submitOne.do"
,
submitTwo
=
"game/submitTwo.do"
,
finalSubmit
=
"game/finalSubmit.do"
,
/**
* 排行榜
*/
...
...
@@ -98,6 +104,7 @@ let dataRecord: {
interface
IWebConfig
{
token
?:
string
;
callback
?:
(
success
:
boolean
,
res
?:
dataOut
)
=>
void
,
hideMsg
?:
boolean
,
isGet
?:
boolean
,
//这两个参数基本不设置,放后面吧
...
...
@@ -138,7 +145,6 @@ export function sendWebNet(
res
.
success
=
res
.
success
||
res
.
ok
;
if
(
!
res
.
success
)
{
if
(
!
hideMsg
)
{
showToast
(
ERR_MESSAGE
[
res
.
code
]
||
res
.
message
||
"网络异常,请稍后再试~"
);
...
...
@@ -182,12 +188,17 @@ export function sendWebNet(
url
=
"mock/"
+
netName
+
".json"
;
}
let
data
=
parameter
||
{};
if
(
data
.
token
)
{
url
+=
"?token="
+
data
.
token
;
delete
data
.
token
;
}
if
(
!
isGet
)
{
data
=
JSON
.
stringify
(
data
);
}
//网络请求
$
.
ajax
({
url
,
//请求地址
...
...
@@ -218,7 +229,7 @@ export function sendWebNetWithToken(
const
res
=
await
sendWebNet
(
netName
,
{
token
,
...
parameter
},
config
config
,
);
r
(
res
);
}
catch
(
e
)
{
...
...
assets/Scripts/store/gameStore.ts
0 → 100644
View file @
1cda4f1d
import
mobx
from
"mobx"
;
import
{
sendWebNet
,
sendWebNetWithToken
,
WebNetName
}
from
"../Utils/WebNet/WebNet"
;
import
{
AESDecrypt
}
from
"../Utils/Crypto"
;
import
{
hideWaiting
,
showWaiting
}
from
"../../Module/UIFast"
;
import
{
startNecCaptcha
}
from
"../Utils/ecaptcha/ecaptcha"
;
const
{
makeAutoObservable
}
=
mobx
;
export
enum
ESpType
{
bag_silver
=
"sp_bag_silver"
,
// 银福袋
revival_card
=
"sp_revival_card"
,
// 复活卡
shield_card
=
"sp_shield_card"
,
// 护盾卡
agility_card
=
"sp_agility_card"
,
// 移速卡
experience_card
=
"sp_experience_card"
,
// 双倍卡
add_length
=
"sp_add_length"
,
// 加长卡
decoration_1
=
"sp_decoration_1"
,
// 蛇皮肤
}
export
interface
IStartInfo
{
barrierFlag
:
boolean
,
// 本局游戏难度是否上升
firstGameFlag
:
boolean
,
// 本局是否第一局,为true则有一,二,无尽模式三个阶段的区别
accumulateLuckNum
:
number
,
// 当局累计获得福袋数量
initScore
:
number
,
// 当局初始分数值
limitLuckNum
:
number
,
// 当日上限可获得福袋数
downArea
:
string
[],
// 掉落分布,集合,比如每日上限6个,这里配置返回1、2、3
currentAcquireNum
:
number
,
// 当局剩余可获得福袋数,不包含accumulateLuckNum,当局累计获得福袋数量
currentStage
:
1
|
2
|
3
,
// 当前应该进入的阶段(1-一阶段 2-二阶段 3-无尽模式)
spCardList
:
[{
spId
:
ESpType
,
num
:
string
}],
// 道具卡集合
currentDressUp
:
"sp_decoration_default"
|
"sp_skin_snake_year"
,
// sp_decoration_default装扮默认皮肤,sp_skin_snake_year装扮蛇皮肤
startId
:
number
,
// 游戏记录ID
slideScore
:
number
,
// 校验滑块的分数值
}
class
GameStore
{
startInfo
:
IStartInfo
=
null
;
async
startGame
()
{
showWaiting
();
const
{
success
,
data
}
=
await
sendWebNetWithToken
(
WebNetName
.
startGame
);
hideWaiting
();
if
(
!
success
)
{
return
false
;
}
const
decrypt
:
IStartInfo
=
JSON
.
parse
(
AESDecrypt
(
data
,
"6FDCE02EBB43C3A8"
,
"cDOiBC1n2QrkAY2P"
));
console
.
log
(
decrypt
);
this
.
startInfo
=
decrypt
;
return
success
;
}
async
submitOne
(
score
:
number
)
{
const
params
=
{
startId
:
this
.
startInfo
.
startId
,
score
,
};
showWaiting
();
const
{
success
,
data
}
=
await
sendWebNetWithToken
(
WebNetName
.
submitOne
,
params
);
hideWaiting
();
if
(
!
success
)
{
return
false
;
}
return
success
;
}
async
submitTwo
(
score
:
number
)
{
const
params
=
{
startId
:
this
.
startInfo
.
startId
,
score
,
};
showWaiting
();
const
{
success
,
data
}
=
await
sendWebNetWithToken
(
WebNetName
.
submitTwo
,
params
);
hideWaiting
();
if
(
!
success
)
{
return
false
;
}
return
success
;
}
async
finalSubmit
(
score
:
number
,
finalKill
:
number
)
{
const
param
:
any
=
{
startId
:
this
.
startInfo
.
startId
,
score
,
finalKill
,
composeSpList
:
[],
};
if
(
score
>=
this
.
startInfo
.
slideScore
)
{
param
.
slideValue
=
await
startNecCaptcha
(
"1ee4615751874cbeaea4dd4681930f61"
,
3
);
}
showWaiting
();
const
{
success
,
data
}
=
await
sendWebNetWithToken
(
WebNetName
.
finalSubmit
,
{
param
},
{
isGet
:
false
,
});
hideWaiting
();
if
(
!
success
)
{
return
false
;
}
return
success
;
}
}
const
gameStore
:
GameStore
=
makeAutoObservable
(
new
GameStore
());
export
default
gameStore
;
\ No newline at end of file
assets/Scripts/
GameMgr
.ts.meta
→
assets/Scripts/
store/gameStore
.ts.meta
View file @
1cda4f1d
...
...
@@ -2,7 +2,7 @@
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "
81ea2780-52ff-45dc-8fa1-ed314e321790
",
"uuid": "
69f78ea4-685a-4330-b18e-8409c08704bf
",
"files": [],
"subMetas": {},
"userData": {}
...
...
assets/Scripts/store/store.ts
View file @
1cda4f1d
...
...
@@ -13,26 +13,6 @@ export interface IHomeInfo {
class
Store
{
miniAppQuery
:
any
=
{};
async
getMiniQuery
()
{
return
new
Promise
<
void
>
((
resolve
)
=>
{
window
[
"my"
].
onMessage
=
(
e
:
any
=
{})
=>
{
const
{
query
,
type
}
=
e
;
if
(
type
==
"getMiniAppQuery"
)
{
this
.
miniAppQuery
=
query
||
{};
resolve
();
}
}
try
{
window
[
"my"
].
postMessage
({
type
:
"getMiniAppQuery"
});
}
catch
(
e
)
{
console
.
error
(
e
);
}
});
}
frontVariable
:
{
[
key
in
string
]:
any
}
=
{}
async
updateFrontVariable
()
{
...
...
assets/Start/Start.ts
View file @
1cda4f1d
...
...
@@ -6,6 +6,7 @@ import { HomeScene } from "db://assets/Scripts/Scenes/HomeScene";
import
{
AudioMgr
}
from
"../core_tgx/base/AudioMgr"
;
import
{
MusicBtn
}
from
"../Component/MusicBtn/MusicBtn"
;
import
ZipLoader
from
"./ZipLoader"
;
import
store
from
"../Scripts/store/store"
;
const
{
ccclass
,
property
}
=
_decorator
;
...
...
@@ -42,6 +43,8 @@ export class Start extends Component {
MusicBtn
.
open
=
localStorage
.
getItem
(
"MusicStatus"
)
!=
"false"
;
// MusicBtn.open = false;
store
.
updateFrontVariable
();
}
onDestroy
()
{
...
...
preview-template/mock/
projectX/
coop_frontVariable.query.json
→
preview-template/mock/coop_frontVariable.query.json
View file @
1cda4f1d
File moved
preview-template/mock/game/start.do.json
deleted
100644 → 0
View file @
a1a04361
{
"success"
:
true
,
"code"
:
""
,
"message"
:
""
,
"data"
:
"P3mmQEAWoW8YQIDomgCRHDxeHF1lz7GrxKgwZQG/fezdjnKg4bRnWIjmEG3HGfhr9PIuFwN8XgWsZ9Mkw9QkpLyJ2n+0XVdu5v6I/6Fwiig="
}
\ No newline at end of file
preview-template/mock/game/startGame.do.json
0 → 100644
View file @
1cda4f1d
{
"success"
:
true
,
"code"
:
""
,
"message"
:
""
,
"data"
:
"Dn22D8mkVmDOfP4ajNWcqtUT2BWK7hLAEHSofRAnITI23/h6M5dk9MJ+cY56DvHjlsXFGC8q3BgSsz56SCAcO6LiZx8tbmrjStn4UcGZq6/W+ZIm0IEma+v0iYkjGBT6bqBnMhA+9JKPvWXKnFJiNR2b8kEDC1Mjt2MH2penAaujIPcM6SAvaaZuTB04+Jtkg598ulZEVdSadszHW0WSzCDjzyl9pUo3ai58aja/O6OPNCmasxQ2HN3MhUZceEZHYRQUj2wA4OgIbGAl86/PLgcfqBnXV2NFox1DfZ4aKKTJxlYOJCrfKM2nx8RaONLCeCqVn3U1bzFqJ1Upn8vKObxrVTSrMYASXNC27cTuH9bGK3lkY+rfXa0jRKAuxSnQRC0SkOJyFz+ZuXZxqKGVhPG5Pnh3iLaYvhyTvYuLynmU7PO4shaMtAaGi6nOlRz0Rd1agq4+8RfQW6PUkemr0Zn2pR4otRBTZw6odXswdwp1mZgl82nZzIwi5NiXaKTCzMDTfBVaeczzUpZLnXt/rPBh4Zn4qyzhNVLBq5/dbt6Minb+7gbX3xMYqpSUiiZD0zfGA25L+dGBa5EjC0/Pkac4Q1mUiVY6CkmqqbRVVC/pxBYdTd7O/xfwfSz5GLrDePkIIE/IsMYx5ovf9DueVQ=="
}
\ No newline at end of file
preview-template/mock/game/startGame数据生成.mjs
0 → 100644
View file @
1cda4f1d
// export enum ESpType {
// bag_silver = "sp_bag_silver", // 银福袋
// revival_card = "sp_revival_card", // 复活卡
// shield_card = "sp_shield_card", // 护盾卡
// agility_card = "sp_agility_card", // 移速卡
// experience_card = "sp_experience_card", // 双倍卡
// add_length = "sp_add_length", // 加长卡
// decoration_1 = "sp_decoration_1", // 蛇皮肤
// }
import
*
as
fs
from
"fs"
;
import
CryptoJS
from
"crypto-js"
;
import
"crypto-js/aes.js"
;
import
"crypto-js/pad-zeropadding.js"
;
const
{
AES
,
enc
,
mode
,
pad
}
=
CryptoJS
;
const
getOptions
=
(
iv
)
=>
{
return
{
iv
:
enc
.
Utf8
.
parse
(
iv
),
mode
:
mode
.
CBC
,
padding
:
pad
.
ZeroPadding
,
};
};
/** 加密 */
const
AESEncrypt
=
(
str
,
key
,
iv
)
=>
{
const
options
=
getOptions
(
iv
);
return
AES
.
encrypt
(
str
,
enc
.
Utf8
.
parse
(
key
),
options
).
toString
();
};
/** 解密 */
const
AESDecrypt
=
(
cipherText
,
key
,
iv
)
=>
{
const
options
=
getOptions
(
iv
);
return
AES
.
decrypt
(
cipherText
,
enc
.
Utf8
.
parse
(
key
),
options
)
.
toString
(
enc
.
Utf8
)
.
trim
()
.
replace
(
//g
,
""
)
.
replace
(
//g
,
""
)
.
replace
(
/
\v
/g
,
""
)
.
replace
(
/
\x
00/g
,
""
);
};
const
startInfo
=
{
barrierFlag
:
true
,
// 本局游戏难度是否上升
firstGameFlag
:
true
,
// 本局是否第一局,为true则有一,二,无尽模式三个阶段的区别
accumulateLuckNum
:
2
,
// 当局累计获得福袋数量
initScore
:
30
,
// 当局初始分数值
limitLuckNum
:
5
,
// 当日上限可获得福袋数
downArea
:
[
3
,
2
,
1
],
// 掉落分布,集合,比如每日上限6个,这里配置返回1、2、3
currentAcquireNum
:
3
,
// 当局剩余可获得福袋数,不包含accumulateLuckNum,当局累计获得福袋数量
currentStage
:
1
,
// 当前应该进入的阶段(1-一阶段 2-二阶段 3-无尽模式)
spCardList
:
[
// 道具卡集合
{
spId
:
"sp_bag_silver"
,
num
:
1
},
{
spId
:
"sp_revival_card"
,
num
:
2
},
{
spId
:
"sp_shield_card"
,
num
:
13
},
{
spId
:
"sp_agility_card"
,
num
:
9
},
{
spId
:
"sp_experience_card"
,
num
:
5
},
{
spId
:
"sp_add_length"
,
num
:
6
},
{
spId
:
"sp_decoration_1"
,
num
:
1
},
],
// sp_decoration_default装扮默认皮肤,sp_skin_snake_year装扮蛇皮肤
currentDressUp
:
"sp_decoration_default"
,
// currentDressUp: "sp_skin_snake_year",
startId
:
12312
,
// 游戏记录ID
slideScore
:
100
,
// 校验滑块的分数值
};
const
encrypt
=
AESEncrypt
(
JSON
.
stringify
(
startInfo
),
"6FDCE02EBB43C3A8"
,
"cDOiBC1n2QrkAY2P"
);
const
json
=
{
success
:
true
,
code
:
""
,
message
:
""
,
data
:
encrypt
};
fs
.
writeFileSync
(
"./startGame.do.json"
,
JSON
.
stringify
(
json
,
null
,
4
));
\ No newline at end of file
preview-template/mock/project
X/project
Rule.query.json
→
preview-template/mock/projectRule.query.json
View file @
1cda4f1d
File moved
preview-template/mock/
projectX/
records.query.json
→
preview-template/mock/records.query.json
View file @
1cda4f1d
File moved
settings/v2/packages/project.json
View file @
1cda4f1d
...
...
@@ -5,7 +5,7 @@
"width"
:
1624
,
"height"
:
750
,
"fitHeight"
:
true
,
"fitWidth"
:
tru
e
"fitWidth"
:
fals
e
},
"downloadMaxConcurrency"
:
20
,
"renderPipeline"
:
"c7e748e8-be82-4f6f-b2c0-085b604e40e5"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment