Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
interactiveGames_Level
Project
Project
Details
Activity
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xuxing@jiuaoedu.com
interactiveGames_Level
Commits
2f3de712
Commit
2f3de712
authored
Nov 08, 2021
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数式接龙好了
parent
d87f860d
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1497 additions
and
75 deletions
+1497
-75
时间框.png
assets/sceneBundle/games/formulaSolitaire/image/时间框.png
+0
-0
时间框.png.meta
assets/sceneBundle/games/formulaSolitaire/image/时间框.png.meta
+74
-0
FormulaSolitaire_1.scene
...dle/games/formulaSolitaire/scene/FormulaSolitaire_1.scene
+1211
-56
FormulaSolitaire_1.scene.meta
...ames/formulaSolitaire/scene/FormulaSolitaire_1.scene.meta
+0
-0
FormulaSolitaireCfg.ts
...ndle/games/formulaSolitaire/script/FormulaSolitaireCfg.ts
+39
-0
FormulaSolitaireCfg.ts.meta
...games/formulaSolitaire/script/FormulaSolitaireCfg.ts.meta
+9
-0
FormulaSolitaireCtr.ts
...ndle/games/formulaSolitaire/script/FormulaSolitaireCtr.ts
+125
-16
FormulaSolitaireItem.ts
...dle/games/formulaSolitaire/script/FormulaSolitaireItem.ts
+1
-1
LevelCfg.ts
assets/startFolder/script/LevelCfg.ts
+29
-0
LevelHomeCtr.ts
assets/startFolder/script/LevelHomeCtr.ts
+1
-1
SceneDef.ts
assets/startFolder/script/common/SceneDef.ts
+8
-1
No files found.
assets/sceneBundle/games/formulaSolitaire/image/时间框.png
0 → 100644
View file @
2f3de712
1.98 KB
assets/sceneBundle/games/formulaSolitaire/image/时间框.png.meta
0 → 100644
View file @
2f3de712
{
"ver": "1.0.21",
"importer": "image",
"imported": true,
"uuid": "4ca08d57-ebb2-435a-910c-7b6c15aa85c8",
"files": [
".png",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "4ca08d57-ebb2-435a-910c-7b6c15aa85c8@6c48a",
"displayName": "时间框",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "4ca08d57-ebb2-435a-910c-7b6c15aa85c8"
},
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "4ca08d57-ebb2-435a-910c-7b6c15aa85c8@f9941",
"displayName": "时间框",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 376,
"height": 69,
"rawWidth": 376,
"rawHeight": 69,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"isUuid": true,
"imageUuidOrDatabaseUri": "4ca08d57-ebb2-435a-910c-7b6c15aa85c8@6c48a",
"atlasUuid": ""
},
"ver": "1.0.9",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": true,
"type": "sprite-frame",
"redirect": "4ca08d57-ebb2-435a-910c-7b6c15aa85c8@f9941"
}
}
assets/sceneBundle/games/formulaSolitaire/scene/FormulaSolitaire.scene
→
assets/sceneBundle/games/formulaSolitaire/scene/FormulaSolitaire
_1
.scene
View file @
2f3de712
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
"_prefab": null,
"_prefab": null,
"autoReleaseAssets": false,
"autoReleaseAssets": false,
"_globals": {
"_globals": {
"__id__":
32
"__id__":
79
},
},
"_id": "1cd9e018-8b35-4525-bca9-8418f7439cca"
"_id": "1cd9e018-8b35-4525-bca9-8418f7439cca"
},
},
...
@@ -210,21 +210,27 @@
...
@@ -210,21 +210,27 @@
},
},
{
{
"__id__": 22
"__id__": 22
},
{
"__id__": 25
},
{
"__id__": 54
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
25
"__id__":
72
},
},
{
{
"__id__":
27
"__id__":
74
},
},
{
{
"__id__":
29
"__id__":
76
},
},
{
{
"__id__":
31
"__id__":
78
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -736,70 +742,200 @@
...
@@ -736,70 +742,200 @@
"_lockFlags": 0,
"_lockFlags": 0,
"_id": "dbdpvhRYNHH7TOIusIbAEA"
"_id": "dbdpvhRYNHH7TOIusIbAEA"
},
},
{
"__type__": "cc.Node",
"_name": "Layout",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 26
},
{
"__id__": 32
},
{
"__id__": 43
}
],
"_active": true,
"_components": [
{
"__id__": 49
},
{
"__id__": 51
},
{
"__id__": 53
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 325,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "d87p/7xs1GrouEdakdi0gT"
},
{
"__type__": "cc.Node",
"_name": "名称框",
"_objFlags": 0,
"_parent": {
"__id__": 25
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 27
},
{
"__id__": 29
},
{
"__id__": 31
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": -526,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "5dmYirkoNFOLcw2HVEoy8h"
},
{
{
"__type__": "cc.UITransform",
"__type__": "cc.UITransform",
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
7
"__id__":
26
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 2
6
"__id__": 2
8
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
1334
,
"width":
262
,
"height":
750
"height":
69
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 0.5,
"x": 0.5,
"y": 0.5
"y": 0.5
},
},
"_id": "
23Xwqno/BJsL+nIqAddgzI
"
"_id": "
4cxTuxaMpFL64gNsuH6Wug
"
},
},
{
{
"__type__": "cc.CompPrefabInfo",
"__type__": "cc.CompPrefabInfo",
"fileId": "
0dngp/9gNO34wUQjZfN/CX
"
"fileId": "
f7NISe7HdAD68SLfhnddy8
"
},
},
{
{
"__type__": "cc.
Canvas
",
"__type__": "cc.
Sprite
",
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
7
"__id__":
26
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__":
28
"__id__":
30
},
},
"_cameraComponent": {
"_visFlags": 0,
"__id__": 9
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
},
"_alignCanvasWithScreen": true,
"_spriteFrame": {
"_id": "78axfk7P1IsbJQvBZ80EHp"
"__uuid__": "27f9e1c5-9a40-47ab-8f5c-721bb5d34eb5@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "14YoHAekVKQJs1PEskhsxU"
},
},
{
{
"__type__": "cc.CompPrefabInfo",
"__type__": "cc.CompPrefabInfo",
"fileId": "
3f2oTdCepERZdpmIfLsrhd
"
"fileId": "
e71ctEmpxFC4KlSYRZNz/a
"
},
},
{
{
"__type__": "cc.Widget",
"__type__": "cc.Widget",
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
7
"__id__":
26
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": null,
"__id__": 30
"_alignFlags": 9,
},
"_alignFlags": 45,
"_target": null,
"_target": null,
"_left": 0,
"_left":
1
0,
"_right": 0,
"_right": 0,
"_top":
0
,
"_top":
15.5
,
"_bottom": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_verticalCenter": 0,
...
@@ -813,48 +949,1067 @@
...
@@ -813,48 +949,1067 @@
"_originalHeight": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_alignMode": 2,
"_lockFlags": 0,
"_lockFlags": 0,
"_id": "868lr3fzNNN7YZbQGoQ2Zt"
"_id": "51ww3D/ZNPOZcQfFinmfkE"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e8a+bU/8dPDbbJguUzLdoF"
},
},
{
{
"__type__": "
2a0e2TL1OJAoISTn0XIADXR
",
"__type__": "
cc.Node
",
"_name": "",
"_name": "
时间框
",
"_objFlags": 0,
"_objFlags": 0,
"
node
": {
"
_parent
": {
"__id__":
7
"__id__":
25
},
},
"_enabled": true,
"_children": [
"__prefab": null,
{
"posArrNode": {
"__id__": 33
"__id__": 22
}
],
"_active": true,
"_components": [
{
"__id__": 38
},
{
"__id__": 40
},
{
"__id__": 42
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 464,
"y": 0,
"z": 0
},
},
"bottomSprNode": {
"_lrot": {
"__id__": 16
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
},
"itemPre": {
"_lscale": {
"__uuid__": "691c3ce4-04d8-44e6-8399-93ef7ce3a485",
"__type__": "cc.Vec3",
"__expectedType__": "cc.Prefab"
"x": 1,
"y": 1,
"z": 1
},
},
"countdownLab": null,
"_layer": 33554432,
"totalTime": 60,
"_euler": {
"_id": "604qNVtc5GtKxU+Lzl4Mik"
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "00+tePsJBBMIyD5GVrvaRs"
},
},
{
{
"__type__": "cc.SceneGlobals",
"__type__": "cc.Node",
"ambient": {
"_name": "timeLab",
"__id__": 33
"_objFlags": 0,
"_parent": {
"__id__": 32
},
},
"shadows": {
"_children": [],
"__id__": 34
"_active": true,
"_components": [
{
"__id__": 34
},
{
"__id__": 36
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 94.847,
"y": 0,
"z": 0
},
},
"_skybox": {
"_lrot": {
"__id__": 35
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
},
"fog": {
"_lscale": {
"__id__": 36
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "a3Sy5LjUpOHIsmQObp/qKf"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
},
"_enabled": true,
"__prefab": {
"__id__": 35
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100.1,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "e7W9i4CydEFKWLO6msxI7k"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
},
"_enabled": true,
"__prefab": {
"__id__": 37
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "00:00",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 40,
"_fontSize": 40,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": "1c6JWiMA9Ckr4els4LOBcR"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
},
"_enabled": true,
"__prefab": {
"__id__": 39
},
"_contentSize": {
"__type__": "cc.Size",
"width": 376,
"height": 69
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "36FE8twstL6Lm2YUmZfpYG"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "f7NISe7HdAD68SLfhnddy8"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
},
"_enabled": true,
"__prefab": {
"__id__": 41
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "4ca08d57-ebb2-435a-910c-7b6c15aa85c8@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "c2r8qak6RM7IafH2bmFcnU"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e71ctEmpxFC4KlSYRZNz/a"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 33,
"_target": null,
"_left": 0,
"_right": 15,
"_top": 15.5,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "b1vr+me/dEDKL5NWX7Jqdb"
},
{
"__type__": "cc.Node",
"_name": "resultLab",
"_objFlags": 0,
"_parent": {
"__id__": 25
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 44
},
{
"__id__": 46
},
{
"__id__": 48
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "e4jXva4ZdOPre9SFh67c6+"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 43
},
"_enabled": true,
"__prefab": {
"__id__": 45
},
"_contentSize": {
"__type__": "cc.Size",
"width": 266.74,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "aeVBfupBBHe5xe13VLnJ6a"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 43
},
"_enabled": true,
"__prefab": {
"__id__": 47
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "正确答案:666",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 40,
"_fontSize": 40,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": "48ixDMIgBGl4xebUuZN2uU"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 43
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 16,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "bbbhbHRghG1oZLsplNeT4h"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"__prefab": {
"__id__": 50
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "8byt9RjqBOJpbIV3KeDOh0"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "71F9vsVsZH7ZFd+PpN0azA"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": false,
"__prefab": {
"__id__": 52
},
"_resizeMode": 1,
"_layoutType": 1,
"_cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_startAxis": 0,
"_paddingLeft": 0,
"_paddingRight": 0,
"_paddingTop": 0,
"_paddingBottom": 0,
"_spacingX": 0,
"_spacingY": 0,
"_verticalDirection": 1,
"_horizontalDirection": 0,
"_constraint": 0,
"_constraintNum": 2,
"_affectedByScale": false,
"_isAlign": false,
"_id": "22fXVDp8lOh7Py3nuPR1m4"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "eaGEkmlCpANK+GS6CImtZa"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 41,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1334,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "bdgUo7irFBBpqziZWQwIqa"
},
{
"__type__": "cc.Node",
"_name": "gameDescBtn",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 55
},
{
"__id__": 60
}
],
"_active": true,
"_components": [
{
"__id__": 65
},
{
"__id__": 67
},
{
"__id__": 69
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 527.627,
"y": 211.904,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "98Dy+ccbdPKo49slGUgFRW"
},
{
"__type__": "cc.Node",
"_name": "bgSpr",
"_objFlags": 0,
"_parent": {
"__id__": 54
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 56
},
{
"__id__": 58
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "bc+U0tf1hLQbm/9zsgLmHA"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
},
"_enabled": true,
"__prefab": {
"__id__": 57
},
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "dejCKqimBMQ7ovnJ0alUy8"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55pCbtzR5GbojKMArZkfim"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
},
"_enabled": true,
"__prefab": {
"__id__": 59
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 120
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "6b6/qPCuNPD5cE52zWuIhK"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "20UGQn4U9GUoln0NJQTkbG"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"_parent": {
"__id__": 54
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 61
},
{
"__id__": 63
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "e9bM82rDhHK5k6wLKIe6XA"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
},
"_enabled": true,
"__prefab": {
"__id__": 62
},
"_contentSize": {
"__type__": "cc.Size",
"width": 128,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "e6bCNa4QRGEqA2cd5jIbyA"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
},
"_enabled": true,
"__prefab": {
"__id__": 64
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "玩法说明",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 32,
"_fontSize": 32,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": "d1Nw2AA6JP2rf1f33QSrJH"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
},
"_enabled": true,
"__prefab": {
"__id__": 66
},
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "ddAnERZ1BNxLoVZfSF5gTS"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "30AFpV6rhJLKJMbjqrvDLm"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
},
"_enabled": true,
"__prefab": {
"__id__": 68
},
"_alignFlags": 33,
"_target": null,
"_left": 0,
"_right": 59.37300000000005,
"_top": 133.096,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "e4SYDWpuhAtp22QPZQevyq"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ebKiXA481GJaVCm3yUMRB/"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
},
"_enabled": true,
"__prefab": {
"__id__": 70
},
"clickEvents": [
{
"__id__": 71
}
],
"_interactable": true,
"_transition": 0,
"_normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_hoverColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_pressedColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_normalSprite": null,
"_hoverSprite": null,
"_pressedSprite": null,
"_disabledSprite": null,
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": null,
"_id": "4c/dcDP0tEroRkwqvLBp6W"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fasaRsl0VPiqKt+O6/ppa2"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 7
},
"component": "",
"_componentId": "2a0e2TL1OJAoISTn0XIADXR",
"handler": "showGameDescView",
"customEventData": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": {
"__id__": 73
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "23Xwqno/BJsL+nIqAddgzI"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "0dngp/9gNO34wUQjZfN/CX"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": {
"__id__": 75
},
"_cameraComponent": {
"__id__": 9
},
"_alignCanvasWithScreen": true,
"_id": "78axfk7P1IsbJQvBZ80EHp"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3f2oTdCepERZdpmIfLsrhd"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": {
"__id__": 77
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "868lr3fzNNN7YZbQGoQ2Zt"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e8a+bU/8dPDbbJguUzLdoF"
},
{
"__type__": "2a0e2TL1OJAoISTn0XIADXR",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": null,
"posArrNode": {
"__id__": 22
},
"bottomSprNode": {
"__id__": 16
},
"itemPre": {
"__uuid__": "691c3ce4-04d8-44e6-8399-93ef7ce3a485",
"__expectedType__": "cc.Prefab"
},
"countdownLab": {
"__id__": 36
},
"totalTime": 100,
"resultLab": {
"__id__": 46
},
"_id": "604qNVtc5GtKxU+Lzl4Mik"
},
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__": 80
},
"shadows": {
"__id__": 81
},
"_skybox": {
"__id__": 82
},
"fog": {
"__id__": 83
}
}
},
},
{
{
...
...
assets/sceneBundle/games/formulaSolitaire/scene/FormulaSolitaire.scene.meta
→
assets/sceneBundle/games/formulaSolitaire/scene/FormulaSolitaire
_1
.scene.meta
View file @
2f3de712
File moved
assets/sceneBundle/games/formulaSolitaire/script/FormulaSolitaireCfg.ts
0 → 100644
View file @
2f3de712
import
{
_decorator
,
Component
,
Node
}
from
'cc'
;
const
{
ccclass
,
property
}
=
_decorator
;
export
interface
FormulaSolitaireCfg
{
row
:
number
,
column
:
number
,
result
:
number
,
resultCount
:
number
,
formulaArr
:
string
[][]
}
//÷ ×
export
const
FS_LV_1
:
FormulaSolitaireCfg
=
{
row
:
4
,
column
:
4
,
result
:
8
,
resultCount
:
2
,
formulaArr
:
[
[
"5"
,
"6"
,
"+"
,
"-"
],
[
"×"
,
"4"
,
"2"
,
"5"
],
[
"8"
,
"+"
,
"1"
,
"-"
],
[
"÷"
,
"2"
,
"-"
,
"11"
]
]
}
export
const
FS_LV_2
:
FormulaSolitaireCfg
=
{
row
:
4
,
column
:
4
,
result
:
12
,
resultCount
:
2
,
formulaArr
:
[
[
"4"
,
"6"
,
"+"
,
"0"
],
[
"×"
,
"÷"
,
"3"
,
"-"
],
[
"2"
,
"6"
,
"×"
,
"1"
],
[
"+"
,
"4"
,
"8"
,
"+"
]
]
}
assets/sceneBundle/games/formulaSolitaire/script/FormulaSolitaireCfg.ts.meta
0 → 100644
View file @
2f3de712
{
"ver": "4.0.22",
"importer": "typescript",
"imported": true,
"uuid": "96e3c939-105b-4aa8-9224-6410ab56497e",
"files": [],
"subMetas": {},
"userData": {}
}
assets/sceneBundle/games/formulaSolitaire/script/FormulaSolitaireCtr.ts
View file @
2f3de712
import
{
_decorator
,
Component
,
Node
,
Sprite
,
Vec3
,
Prefab
,
Label
,
CCFloat
,
instantiate
,
UITransform
,
v3
,
director
,
EventTouch
,
v2
,
Color
}
from
'cc'
;
import
{
_decorator
,
Component
,
Node
,
Sprite
,
Vec3
,
Prefab
,
Label
,
CCFloat
,
instantiate
,
UITransform
,
v3
,
director
,
EventTouch
,
v2
,
Color
}
from
'cc'
;
import
{
countdownMus
,
failMus
,
succMus
}
from
'../../../../startFolder/script/common/AudioDef'
;
import
{
AudioMgr
}
from
'../../../../startFolder/script/common/AudioMgr'
;
import
{
Utils
}
from
'../../../../startFolder/script/common/Utils'
;
import
{
VIEW_DEF
}
from
'../../../../startFolder/script/common/ViewDef'
;
import
{
VIEW_DEF
}
from
'../../../../startFolder/script/common/ViewDef'
;
import
{
viewMgr
}
from
'../../../../startFolder/script/common/ViewMgr'
;
import
{
viewMgr
,
VIEW_INDEX
}
from
'../../../../startFolder/script/common/ViewMgr'
;
import
{
BeginCountdownView
}
from
'../../commonView/script/BeginCountdownView'
;
import
{
ChallengeSuccView
}
from
'../../commonView/script/ChallengeSuccView'
;
import
{
GameDescView
}
from
'../../commonView/script/GameDescView'
;
import
{
GameDescView
}
from
'../../commonView/script/GameDescView'
;
import
{
FormulaSolitaireCfg
,
FS_LV_1
,
FS_LV_2
}
from
'./FormulaSolitaireCfg'
;
import
{
FormulaSolitaireItem
,
FS_ITEM_STATE
}
from
'./FormulaSolitaireItem'
;
import
{
FormulaSolitaireItem
,
FS_ITEM_STATE
}
from
'./FormulaSolitaireItem'
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
...
@@ -61,6 +67,9 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -61,6 +67,9 @@ export class FormulaSolitaireCtr extends Component {
@
property
(
CCFloat
)
@
property
(
CCFloat
)
totalTime
:
number
=
0
;
totalTime
:
number
=
0
;
@
property
(
Label
)
resultLab
:
Label
=
null
!
;
private
itemWidth
=
100
;
private
itemWidth
=
100
;
private
itemHeight
=
100
;
private
itemHeight
=
100
;
private
itemSpaceX
=
2
;
private
itemSpaceX
=
2
;
...
@@ -80,10 +89,13 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -80,10 +89,13 @@ export class FormulaSolitaireCtr extends Component {
private
curLinePointArr
:
ItemPosIfo
[]
=
[];
private
curLinePointArr
:
ItemPosIfo
[]
=
[];
private
allLinePointArr
:
ItemPosIfo
[][]
=
[];
private
allLinePointArr
:
ItemPosIfo
[][]
=
[];
private
level
=
2
;
private
levelData
:
FormulaSolitaireCfg
=
null
!
;
showGameDescView
()
{
showGameDescView
()
{
this
.
isShowGameDescViewOnce
=
true
;
this
.
isShowGameDescViewOnce
=
true
;
viewMgr
.
openView
(
VIEW_DEF
.
GameDescView
,
(
node
)
=>
{
viewMgr
.
openView
(
VIEW_DEF
.
GameDescView
,
(
node
)
=>
{
node
.
getComponent
(
GameDescView
)?.
setDesc
(
"
把算式连接在一起。
"
);
node
.
getComponent
(
GameDescView
)?.
setDesc
(
"
划过图中的数字和算式运算符,把它们连接在一起组成一个式子,
\
n得到上方的结果。
\
n成功条件:尽可能多的组合能得到正确答案的式子。
\
n注意:再次划过已经组合完成的式子可以拆散还原。
\
n有些数字和运算符可能不会用到
"
);
});
});
}
}
...
@@ -114,6 +126,17 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -114,6 +126,17 @@ export class FormulaSolitaireCtr extends Component {
start
()
{
start
()
{
// [3]
// [3]
director
.
on
(
"begin_countdown_end"
,
()
=>
{
//引导
if
(
!
this
.
isShowGameDescViewOnce
)
{
this
.
gameState
=
GAME_STATE
.
PAUSE
;
this
.
showGameDescView
();
}
else
{
this
.
gameState
=
GAME_STATE
.
IDLE
;
}
},
this
);
director
.
on
(
"game_desc_close"
,
this
.
onCloseGameDescView
,
this
);
this
.
posArrNode
.
on
(
Node
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
this
.
posArrNode
.
on
(
Node
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
this
.
posArrNode
.
on
(
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onTouchMove
,
this
);
this
.
posArrNode
.
on
(
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onTouchMove
,
this
);
this
.
posArrNode
.
on
(
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
this
.
posArrNode
.
on
(
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
...
@@ -195,6 +218,12 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -195,6 +218,12 @@ export class FormulaSolitaireCtr extends Component {
selPoint
.
target
.
getComponent
(
FormulaSolitaireItem
)?.
setColor
(
Color
.
fromHEX
(
new
Color
(),
colorStr
));
selPoint
.
target
.
getComponent
(
FormulaSolitaireItem
)?.
setColor
(
Color
.
fromHEX
(
new
Color
(),
colorStr
));
}
}
this
.
paintPaths
();
this
.
paintPaths
();
if
(
this
.
checkWin
())
{
this
.
gameEnd
(
true
);
}
else
{
}
}
}
paintPaths
()
{
paintPaths
()
{
...
@@ -224,30 +253,64 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -224,30 +253,64 @@ export class FormulaSolitaireCtr extends Component {
}
}
}
}
}
}
}
console
.
log
(
`线段集合`
);
gameEnd
(
isWin
:
boolean
)
{
console
.
log
(
this
.
allLinePointArr
);
this
.
gameState
=
GAME_STATE
.
END
;
if
(
isWin
)
{
viewMgr
.
openView
(
VIEW_DEF
.
ChallengeSuccView
,
(
node
)
=>
{
AudioMgr
.
playOneShot
(
succMus
);
node
?.
getComponent
(
ChallengeSuccView
)?.
init
();
},
VIEW_INDEX
.
TOP
);
}
else
{
viewMgr
.
openView
(
VIEW_DEF
.
ChallengeFailView
,
(
node
)
=>
{
AudioMgr
.
playOneShot
(
failMus
);
},
VIEW_INDEX
.
TOP
);
}
}
}
getResult
(
numStrArr
:
string
[]){
checkWin
()
{
if
(
this
.
allLinePointArr
.
length
<
this
.
levelData
.
resultCount
)
return
false
;
let
retArr
:
number
[][]
=
[];
for
(
let
i
=
0
;
i
<
this
.
allLinePointArr
.
length
;
++
i
)
{
let
numAtrArr
:
string
[]
=
[];
for
(
let
j
=
0
;
j
<
this
.
allLinePointArr
[
i
].
length
;
++
j
)
{
numAtrArr
.
push
(
this
.
allLinePointArr
[
i
][
j
].
target
.
getComponent
(
FormulaSolitaireItem
)
!
.
getText
());
}
console
.
log
(
`检测一个算式`
);
console
.
log
(
numAtrArr
);
retArr
.
push
(
this
.
getResult
(
numAtrArr
));
}
let
count
=
0
;
for
(
let
i
=
0
;
i
<
retArr
.
length
;
++
i
)
{
if
(
retArr
[
i
].
indexOf
(
this
.
levelData
.
result
)
!=
-
1
)
count
+=
1
;
}
console
.
log
(
`所有结果`
);
console
.
log
(
retArr
);
if
(
count
>=
this
.
levelData
.
resultCount
)
return
true
;
return
false
;
}
getResult
(
numStrArr
:
string
[])
{
let
ret
:
any
[]
=
[];
let
ret
:
any
[]
=
[];
try
{
try
{
let
tempArr
:
string
[]
=
[];
let
tempArr
:
string
[]
=
[];
tempArr
=
tempArr
.
concat
(
numStrArr
);
tempArr
=
tempArr
.
concat
(
numStrArr
);
ret
.
push
(
this
.
calculator
(
tempArr
));
ret
.
push
(
this
.
calculator
(
tempArr
));
}
}
catch
{
catch
{
console
.
log
(
`错误的算式1`
);
console
.
log
(
`错误的算式1`
);
ret
.
push
(
null
);
ret
.
push
(
null
);
}
}
try
{
try
{
let
tempArr
:
string
[]
=
[];
let
tempArr
:
string
[]
=
[];
tempArr
=
tempArr
.
concat
(
numStrArr
);
tempArr
=
tempArr
.
concat
(
numStrArr
);
tempArr
=
tempArr
.
reverse
();
tempArr
=
tempArr
.
reverse
();
ret
.
push
(
this
.
calculator
(
tempArr
));
ret
.
push
(
this
.
calculator
(
tempArr
));
}
}
catch
{
catch
{
console
.
log
(
`错误的算式2`
);
console
.
log
(
`错误的算式2`
);
ret
.
push
(
null
);
ret
.
push
(
null
);
}
}
...
@@ -257,7 +320,7 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -257,7 +320,7 @@ export class FormulaSolitaireCtr extends Component {
findLineWithPoint
(
point
:
ItemPosIfo
)
{
findLineWithPoint
(
point
:
ItemPosIfo
)
{
for
(
let
i
=
0
;
i
<
this
.
allLinePointArr
.
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
this
.
allLinePointArr
.
length
;
++
i
)
{
for
(
let
j
=
0
;
j
<
this
.
allLinePointArr
[
i
].
length
;
++
j
)
{
for
(
let
j
=
0
;
j
<
this
.
allLinePointArr
[
i
].
length
;
++
j
)
{
if
(
point
.
id
==
this
.
allLinePointArr
[
i
][
j
].
id
)
{
if
(
point
.
id
==
this
.
allLinePointArr
[
i
][
j
].
id
)
{
return
this
.
allLinePointArr
[
i
];
return
this
.
allLinePointArr
[
i
];
}
}
}
}
...
@@ -267,12 +330,17 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -267,12 +330,17 @@ export class FormulaSolitaireCtr extends Component {
gameStart
()
{
gameStart
()
{
this
.
gameState
=
GAME_STATE
.
READY
;
this
.
gameState
=
GAME_STATE
.
READY
;
this
.
countdownLab
.
string
=
Utils
.
formatTime
(
Math
.
floor
(
this
.
totalTime
*
1000
));
this
.
usedColorArr
=
[];
this
.
usedColorArr
=
[];
this
.
curLinePointArr
=
[];
this
.
curLinePointArr
=
[];
this
.
allLinePointArr
=
[];
this
.
allLinePointArr
=
[];
this
.
loadLevelData
();
this
.
resultLab
.
string
=
`正确答案:`
+
this
.
levelData
.
result
;
this
.
creAllItem
();
this
.
creAllItem
();
this
.
setBgSprSize
();
this
.
setBgSprSize
();
this
.
gameState
=
GAME_STATE
.
IDLE
;
viewMgr
.
openView
(
VIEW_DEF
.
BeginCountdownView
,
(
node
)
=>
{
node
.
getComponent
(
BeginCountdownView
)?.
init
();
},
VIEW_INDEX
.
UPPER
);
}
}
getRandomItemColor
()
{
getRandomItemColor
()
{
...
@@ -295,6 +363,7 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -295,6 +363,7 @@ export class FormulaSolitaireCtr extends Component {
this
.
itemPosIfoArr
[
i
].
target
=
node
;
this
.
itemPosIfoArr
[
i
].
target
=
node
;
node
.
getComponent
(
FormulaSolitaireItem
)?.
setItemState
(
FS_ITEM_STATE
.
CENTER
);
node
.
getComponent
(
FormulaSolitaireItem
)?.
setItemState
(
FS_ITEM_STATE
.
CENTER
);
node
.
getComponent
(
FormulaSolitaireItem
)?.
setColor
(
Color
.
fromHEX
(
new
Color
(),
this
.
orgColor
));
node
.
getComponent
(
FormulaSolitaireItem
)?.
setColor
(
Color
.
fromHEX
(
new
Color
(),
this
.
orgColor
));
node
.
getComponent
(
FormulaSolitaireItem
)?.
setText
(
this
.
levelData
.
formulaArr
[
this
.
itemPosIfoArr
[
i
].
yIdx
][
this
.
itemPosIfoArr
[
i
].
xIdx
]);
}
}
}
}
...
@@ -352,9 +421,12 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -352,9 +421,12 @@ export class FormulaSolitaireCtr extends Component {
}
}
}
}
if
(
operatorIdx
==
0
||
operatorIdx
==
numStrArr
.
length
-
1
)
{
if
(
operatorIdx
==
0
||
operatorIdx
==
numStrArr
.
length
-
1
)
{
throw
new
Error
(
`传入的算式不符合规则`
);
throw
new
Error
(
`传入的算式不符合规则1`
);
}
if
(
operatorIdx
==
-
1
)
{
if
(
numStrArr
.
length
==
1
)
return
Number
(
numStrArr
[
0
]);
else
throw
new
Error
(
`传入的算式不符合规则2`
);
}
}
if
(
operatorIdx
==
-
1
)
return
Number
(
numStrArr
[
0
]);
let
num_1
=
Number
(
numStrArr
[
operatorIdx
-
1
]);
let
num_1
=
Number
(
numStrArr
[
operatorIdx
-
1
]);
let
num_2
=
Number
(
numStrArr
[
operatorIdx
+
1
]);
let
num_2
=
Number
(
numStrArr
[
operatorIdx
+
1
]);
let
num_ret
=
0
;
let
num_ret
=
0
;
...
@@ -415,7 +487,43 @@ export class FormulaSolitaireCtr extends Component {
...
@@ -415,7 +487,43 @@ export class FormulaSolitaireCtr extends Component {
return
FS_ITEM_STATE
.
LEFT
;
return
FS_ITEM_STATE
.
LEFT
;
}
}
}
}
// update (deltaTime: number) {
// // [4]
loadLevelData
()
{
// }
switch
(
this
.
level
)
{
case
1
:
this
.
levelData
=
FS_LV_1
;
break
;
case
2
:
this
.
levelData
=
FS_LV_2
;
break
;
default
:
this
.
levelData
=
FS_LV_1
;
break
;
}
this
.
row
=
this
.
levelData
.
row
;
this
.
column
=
this
.
levelData
.
column
;
}
//倒计时
countdownTime
(
dt
:
number
)
{
if
(
this
.
gameState
==
GAME_STATE
.
READY
||
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
{
return
;
}
this
.
costTime
+=
dt
;
if
(
!
this
.
isPlayCountdownMus
&&
this
.
totalTime
-
this
.
costTime
<
3.5
)
{
this
.
isPlayCountdownMus
=
true
;
AudioMgr
.
playOneShot
(
countdownMus
);
}
if
(
this
.
totalTime
-
this
.
costTime
<=
0
)
{
console
.
log
(
`游戏时间到`
);
this
.
gameEnd
(
false
);
return
;
}
this
.
countdownLab
.
string
=
Utils
.
formatTime
(
Math
.
floor
((
this
.
totalTime
-
this
.
costTime
)
*
1000
));
}
update
(
deltaTime
:
number
)
{
// [4]
this
.
countdownTime
(
deltaTime
);
}
}
}
\ No newline at end of file
assets/sceneBundle/games/formulaSolitaire/script/FormulaSolitaireItem.ts
View file @
2f3de712
...
@@ -55,7 +55,7 @@ export class FormulaSolitaireItem extends Component {
...
@@ -55,7 +55,7 @@ export class FormulaSolitaireItem extends Component {
setText
(
text
:
string
){
setText
(
text
:
string
){
this
.
textLab
.
string
=
text
;
this
.
textLab
.
string
=
text
;
this
.
textLab
.
string
=
text
;
this
.
_text
=
text
;
}
}
getText
(){
getText
(){
...
...
assets/startFolder/script/LevelCfg.ts
View file @
2f3de712
...
@@ -1137,4 +1137,32 @@ export const levelCfg: OneVarLevelItf[] = [
...
@@ -1137,4 +1137,32 @@ export const levelCfg: OneVarLevelItf[] = [
}
}
]
]
}
}
,
{
gameIdHead
:
190
,
title
:
"数式接龙"
,
desc
:
"数式接龙,第一个版本"
,
levelArr
:
[{
gameId
:
19001
,
sceneUnitIfo
:
SCENE_DEF
.
FormulaSolitaire_1
,
comName
:
"FormulaSolitaireCtr"
,
level
:
1
,
resData
:
{
totalTime
:
60
,
level
:
1
,
isShowGuide
:
true
}
}
,
{
gameId
:
19002
,
sceneUnitIfo
:
SCENE_DEF
.
FormulaSolitaire_1
,
comName
:
"FormulaSolitaireCtr"
,
level
:
2
,
resData
:
{
totalTime
:
120
,
level
:
2
}
}
]
}
];
];
\ No newline at end of file
assets/startFolder/script/LevelHomeCtr.ts
View file @
2f3de712
...
@@ -26,7 +26,7 @@ export class LevelHomeCtr extends Component {
...
@@ -26,7 +26,7 @@ export class LevelHomeCtr extends Component {
// [3]
// [3]
if
(
!
levelMgr
.
loadedOutData
)
{
if
(
!
levelMgr
.
loadedOutData
)
{
levelMgr
.
loadedOutData
=
true
;
levelMgr
.
loadedOutData
=
true
;
levelMgr
.
gameIdHead
=
1
8
0
;
levelMgr
.
gameIdHead
=
1
9
0
;
levelMgr
.
unLockCount
=
10
;
levelMgr
.
unLockCount
=
10
;
if
(
Utils
.
getValueFromHref
(
"gameIdHead"
))
{
if
(
Utils
.
getValueFromHref
(
"gameIdHead"
))
{
levelMgr
.
gameIdHead
=
Number
(
Utils
.
getValueFromHref
(
"gameIdHead"
));
levelMgr
.
gameIdHead
=
Number
(
Utils
.
getValueFromHref
(
"gameIdHead"
));
...
...
assets/startFolder/script/common/SceneDef.ts
View file @
2f3de712
...
@@ -105,6 +105,8 @@ interface ScenePathItf {
...
@@ -105,6 +105,8 @@ interface ScenePathItf {
AdjacentArray_1
:
ScenePathUnitItf
,
AdjacentArray_1
:
ScenePathUnitItf
,
//纵横填数
//纵横填数
VHFillNum_1
:
ScenePathUnitItf
,
VHFillNum_1
:
ScenePathUnitItf
,
//数式接龙
FormulaSolitaire_1
:
ScenePathUnitItf
,
}
}
export
const
SCENE_DEF
:
ScenePathItf
=
{
export
const
SCENE_DEF
:
ScenePathItf
=
{
TestScene
:
{
TestScene
:
{
...
@@ -447,9 +449,14 @@ export const SCENE_DEF: ScenePathItf = {
...
@@ -447,9 +449,14 @@ export const SCENE_DEF: ScenePathItf = {
sceneName
:
"AdjacentArray_1"
,
sceneName
:
"AdjacentArray_1"
,
desc
:
"邻接数组,第一个版本"
desc
:
"邻接数组,第一个版本"
},
},
VHFillNum_1
:
{
VHFillNum_1
:
{
bundleName
:
"sceneBundle"
,
bundleName
:
"sceneBundle"
,
sceneName
:
"VHFillNum_1"
,
sceneName
:
"VHFillNum_1"
,
desc
:
"纵横填数,第一个版本"
desc
:
"纵横填数,第一个版本"
},
},
FormulaSolitaire_1
:
{
bundleName
:
"sceneBundle"
,
sceneName
:
"FormulaSolitaire_1"
,
desc
:
"数式接龙,第一个版本"
},
}
}
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