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
d3961078
Commit
d3961078
authored
Feb 10, 2022
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数阵推理好了
parent
54ac77fd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
690 additions
and
32 deletions
+690
-32
对勾.png
assets/sceneBundle/games/numMatReason/image/对勾.png
+0
-0
对勾.png.meta
assets/sceneBundle/games/numMatReason/image/对勾.png.meta
+74
-0
NumMatReasonItem.prefab
...eBundle/games/numMatReason/prefab/NumMatReasonItem.prefab
+141
-5
NumMatReason_1.scene
...sceneBundle/games/numMatReason/scene/NumMatReason_1.scene
+427
-14
NumMatReasonCtr.ts
.../sceneBundle/games/numMatReason/script/NumMatReasonCtr.ts
+45
-13
NumMatReasonItem.ts
...sceneBundle/games/numMatReason/script/NumMatReasonItem.ts
+3
-0
No files found.
assets/sceneBundle/games/numMatReason/image/对勾.png
0 → 100644
View file @
d3961078
2.57 KB
assets/sceneBundle/games/numMatReason/image/对勾.png.meta
0 → 100644
View file @
d3961078
{
"ver": "1.0.21",
"importer": "image",
"imported": true,
"uuid": "998dba9a-5916-4ce3-b3c4-5c96e38914cf",
"files": [
".png",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "998dba9a-5916-4ce3-b3c4-5c96e38914cf@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": "998dba9a-5916-4ce3-b3c4-5c96e38914cf"
},
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "998dba9a-5916-4ce3-b3c4-5c96e38914cf@f9941",
"displayName": "对勾",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 3.5,
"offsetY": -14,
"trimX": 8,
"trimY": 28,
"width": 93,
"height": 72,
"rawWidth": 102,
"rawHeight": 100,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"isUuid": true,
"imageUuidOrDatabaseUri": "998dba9a-5916-4ce3-b3c4-5c96e38914cf@6c48a",
"atlasUuid": ""
},
"ver": "1.0.9",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": true,
"type": "sprite-frame",
"redirect": "998dba9a-5916-4ce3-b3c4-5c96e38914cf@f9941"
}
}
assets/sceneBundle/games/numMatReason/prefab/NumMatReasonItem.prefab
View file @
d3961078
...
@@ -24,19 +24,22 @@
...
@@ -24,19 +24,22 @@
},
},
{
{
"__id__": 12
"__id__": 12
},
{
"__id__": 18
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
18
"__id__":
24
},
},
{
{
"__id__": 2
0
"__id__": 2
6
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 2
2
"__id__": 2
8
},
},
"_lpos": {
"_lpos": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
...
@@ -407,6 +410,136 @@
...
@@ -407,6 +410,136 @@
},
},
"fileId": "3e6UQRrQ9L8ItAXFoN39//"
"fileId": "3e6UQRrQ9L8ItAXFoN39//"
},
},
{
"__type__": "cc.Node",
"_name": "对勾",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 19
},
{
"__id__": 21
}
],
"_prefab": {
"__id__": 23
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 26,
"y": -31.295,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 0.5,
"y": 0.5,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
},
"_enabled": true,
"__prefab": {
"__id__": 20
},
"_contentSize": {
"__type__": "cc.Size",
"width": 93,
"height": 72
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "f7NISe7HdAD68SLfhnddy8"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
},
"_enabled": true,
"__prefab": {
"__id__": 22
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "998dba9a-5916-4ce3-b3c4-5c96e38914cf@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": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e71ctEmpxFC4KlSYRZNz/a"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b3axG7xP5JTZOX+nP0YoT6"
},
{
{
"__type__": "cc.UITransform",
"__type__": "cc.UITransform",
"_name": "",
"_name": "",
...
@@ -416,7 +549,7 @@
...
@@ -416,7 +549,7 @@
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__":
19
"__id__":
25
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
...
@@ -443,7 +576,7 @@
...
@@ -443,7 +576,7 @@
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 2
1
"__id__": 2
7
},
},
"clickNode": {
"clickNode": {
"__id__": 2
"__id__": 2
...
@@ -454,6 +587,9 @@
...
@@ -454,6 +587,9 @@
"numLab": {
"numLab": {
"__id__": 15
"__id__": 15
},
},
"tickSprNode": {
"__id__": 18
},
"_id": ""
"_id": ""
},
},
{
{
...
...
assets/sceneBundle/games/numMatReason/scene/NumMatReason_1.scene
View file @
d3961078
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
"_prefab": null,
"_prefab": null,
"autoReleaseAssets": false,
"autoReleaseAssets": false,
"_globals": {
"_globals": {
"__id__": 1
61
"__id__": 1
77
},
},
"_id": "94d615be-2f2a-47b1-a1a0-aa1f51c47468"
"_id": "94d615be-2f2a-47b1-a1a0-aa1f51c47468"
},
},
...
@@ -216,21 +216,24 @@
...
@@ -216,21 +216,24 @@
},
},
{
{
"__id__": 75
"__id__": 75
},
{
"__id__": 154
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
54
"__id__": 1
70
},
},
{
{
"__id__": 1
56
"__id__": 1
72
},
},
{
{
"__id__": 1
58
"__id__": 1
74
},
},
{
{
"__id__": 1
60
"__id__": 1
76
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -318,7 +321,7 @@
...
@@ -318,7 +321,7 @@
"_priority": 1073741824,
"_priority": 1073741824,
"_fov": 45,
"_fov": 45,
"_fovAxis": 0,
"_fovAxis": 0,
"_orthoHeight":
411.7
,
"_orthoHeight":
375.00000000000006
,
"_near": 1,
"_near": 1,
"_far": 2000,
"_far": 2000,
"_color": {
"_color": {
...
@@ -2011,7 +2014,7 @@
...
@@ -2011,7 +2014,7 @@
"__id__": 133
"__id__": 133
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 152
"__id__": 152
...
@@ -4079,17 +4082,427 @@
...
@@ -4079,17 +4082,427 @@
"checkEvents": [],
"checkEvents": [],
"_id": "a3Jz5lSStHLIKj4nBY6Ls4"
"_id": "a3Jz5lSStHLIKj4nBY6Ls4"
},
},
{
"__type__": "cc.Node",
"_name": "resetBtn",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 155
},
{
"__id__": 160
}
],
"_active": true,
"_components": [
{
"__id__": 165
},
{
"__id__": 167
},
{
"__id__": 169
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 527.627,
"y": -215.945,
"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": "b9lM0CyR9LvJSOEsfS06UU"
},
{
"__type__": "cc.Node",
"_name": "bgSpr",
"_objFlags": 0,
"_parent": {
"__id__": 154
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 156
},
{
"__id__": 158
}
],
"_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": "00Zx11BVJLnYebPP1QPqZe"
},
{
{
"__type__": "cc.UITransform",
"__type__": "cc.UITransform",
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
7
"__id__":
155
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 157
},
"_contentSize": {
"__type__": "cc.Size",
"width": 120,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "d7GMl4RxtLxLPLrEQHf1hn"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55pCbtzR5GbojKMArZkfim"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 155
"__id__": 155
},
},
"_enabled": true,
"__prefab": {
"__id__": 159
},
"_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": "c8RHPwI6FCm4W+3zXcot9B"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "20UGQn4U9GUoln0NJQTkbG"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"_parent": {
"__id__": 154
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 161
},
{
"__id__": 163
}
],
"_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": "a2WB81BX9Pzos0xqklC/XL"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 160
},
"_enabled": true,
"__prefab": {
"__id__": 162
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "fbvrhJ+LhH0r7GnBH75gDc"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 160
},
"_enabled": true,
"__prefab": {
"__id__": 164
},
"_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": 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": "6eEXxbJT9Pa4ZjeGYpIO/i"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 154
},
"_enabled": true,
"__prefab": {
"__id__": 166
},
"_contentSize": {
"__type__": "cc.Size",
"width": 120,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "a5fBoUcjNP3ZokJRkarVAF"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55pCbtzR5GbojKMArZkfim"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 154
},
"_enabled": true,
"__prefab": null,
"clickEvents": [
{
"__id__": 168
}
],
"_interactable": true,
"_transition": 3,
"_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": 0.85,
"_target": null,
"_id": "8bmpPFUKNHZI5+5Nv5bz+M"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 7
},
"component": "",
"_componentId": "a5e262EmSxF7qOHRkohlP7Q",
"handler": "onResetBtnClick",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 154
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 36,
"_target": null,
"_left": 0,
"_right": 79.37300000000005,
"_top": 0,
"_bottom": 129.055,
"_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": "02X5X72ZZA9LoTK5bjN2s8"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": {
"__id__": 171
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 1334,
"width": 1334,
...
@@ -4115,7 +4528,7 @@
...
@@ -4115,7 +4528,7 @@
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 1
57
"__id__": 1
73
},
},
"_cameraComponent": {
"_cameraComponent": {
"__id__": 9
"__id__": 9
...
@@ -4136,7 +4549,7 @@
...
@@ -4136,7 +4549,7 @@
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__": 1
59
"__id__": 1
75
},
},
"_alignFlags": 45,
"_alignFlags": 45,
"_target": null,
"_target": null,
...
@@ -4193,16 +4606,16 @@
...
@@ -4193,16 +4606,16 @@
{
{
"__type__": "cc.SceneGlobals",
"__type__": "cc.SceneGlobals",
"ambient": {
"ambient": {
"__id__": 1
62
"__id__": 1
78
},
},
"shadows": {
"shadows": {
"__id__": 1
63
"__id__": 1
79
},
},
"_skybox": {
"_skybox": {
"__id__": 1
64
"__id__": 1
80
},
},
"fog": {
"fog": {
"__id__": 1
65
"__id__": 1
81
}
}
},
},
{
{
...
...
assets/sceneBundle/games/numMatReason/script/NumMatReasonCtr.ts
View file @
d3961078
...
@@ -9,6 +9,7 @@ import { BeginCountdownView } from '../../commonView/script/BeginCountdownView';
...
@@ -9,6 +9,7 @@ import { BeginCountdownView } from '../../commonView/script/BeginCountdownView';
import
{
ChallengeFailView
}
from
'../../commonView/script/ChallengeFailView'
;
import
{
ChallengeFailView
}
from
'../../commonView/script/ChallengeFailView'
;
import
{
ChallengeSuccView
}
from
'../../commonView/script/ChallengeSuccView'
;
import
{
ChallengeSuccView
}
from
'../../commonView/script/ChallengeSuccView'
;
import
{
GameDescView
}
from
'../../commonView/script/GameDescView'
;
import
{
GameDescView
}
from
'../../commonView/script/GameDescView'
;
import
{
SwitchOkView
}
from
'../../commonView/script/SwitchOkView'
;
import
{
numMatReaCfg
,
NumMatReaLVItf
}
from
'./NumMatReasonCfg'
;
import
{
numMatReaCfg
,
NumMatReaLVItf
}
from
'./NumMatReasonCfg'
;
import
{
NumMatItem
}
from
'./NumMatReasonItem'
;
import
{
NumMatItem
}
from
'./NumMatReasonItem'
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
...
@@ -94,7 +95,7 @@ export class NumMatReasonCtr extends Component {
...
@@ -94,7 +95,7 @@ export class NumMatReasonCtr extends Component {
//@ts-ignore
//@ts-ignore
this
.
isShowGameDescViewOnce
=
false
;
this
.
isShowGameDescViewOnce
=
false
;
}
}
else
{
else
{
this
.
isShowGameDescViewOnce
=
true
;
this
.
isShowGameDescViewOnce
=
true
;
}
}
}
}
...
@@ -130,13 +131,18 @@ export class NumMatReasonCtr extends Component {
...
@@ -130,13 +131,18 @@ export class NumMatReasonCtr extends Component {
},
VIEW_INDEX
.
UPPER
);
},
VIEW_INDEX
.
UPPER
);
}
}
gameEnd
(
isWin
:
boolean
){
gameEnd
(
isWin
:
boolean
)
{
this
.
gameState
=
GAME_STATE
.
END
;
this
.
gameState
=
GAME_STATE
.
END
;
if
(
isWin
)
{
if
(
isWin
)
{
viewMgr
.
openView
(
VIEW_DEF
.
ChallengeSuccView
,
(
node
)
=>
{
AudioMgr
.
playEffect
(
succMus
);
AudioMgr
.
playEffect
(
succMus
);
viewMgr
.
openView
(
VIEW_DEF
.
SwitchOkView
,
(
node
)
=>
{
node
?.
getComponent
(
ChallengeSuccView
)?.
init
();
node
.
getComponent
(
SwitchOkView
)
!
.
endCb
=
()
=>
{
},
VIEW_INDEX
.
TOP
);
viewMgr
.
openView
(
VIEW_DEF
.
ChallengeSuccView
,
(
node
)
=>
{
node
?.
getComponent
(
ChallengeSuccView
)?.
init
();
},
VIEW_INDEX
.
TOP
);
};
node
.
getComponent
(
SwitchOkView
)?.
init
(
1.5
);
});
}
}
else
{
else
{
viewMgr
.
openView
(
VIEW_DEF
.
ChallengeFailView
,
(
node
)
=>
{
viewMgr
.
openView
(
VIEW_DEF
.
ChallengeFailView
,
(
node
)
=>
{
...
@@ -171,13 +177,17 @@ export class NumMatReasonCtr extends Component {
...
@@ -171,13 +177,17 @@ export class NumMatReasonCtr extends Component {
}
}
onItemClick
(
item
:
NumMatItem
)
{
onItemClick
(
item
:
NumMatItem
)
{
if
(
this
.
gameState
==
GAME_STATE
.
READY
||
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
{
return
;
}
if
(
item
.
getPosIfo
().
xIdx
==
this
.
column
-
1
||
item
.
getPosIfo
().
yIdx
==
this
.
row
-
1
)
return
;
if
(
item
.
getPosIfo
().
xIdx
==
this
.
column
-
1
||
item
.
getPosIfo
().
yIdx
==
this
.
row
-
1
)
return
;
if
(
this
.
gameState
==
GAME_STATE
.
SELECT
)
{
if
(
this
.
gameState
==
GAME_STATE
.
SELECT
)
{
item
.
setBgColor
(
this
.
levelData
.
selColor
);
item
.
isSelected
=
!
item
.
isSelected
;
item
.
setTextColor
(
this
.
levelData
.
selNumColor
);
item
.
setBgColor
(
item
.
isSelected
?
this
.
levelData
.
selColor
:
this
.
levelData
.
idleColor
);
item
.
isSelected
=
true
;
item
.
setTextColor
(
item
.
isSelected
?
this
.
levelData
.
selNumColor
:
this
.
levelData
.
idleNumColor
);
// item.isSelected = true;
}
}
else
if
(
this
.
gameState
==
GAME_STATE
.
ERASE
)
{
else
if
(
this
.
gameState
==
GAME_STATE
.
ERASE
)
{
item
.
setBgColor
(
this
.
levelData
.
idleColor
);
item
.
setBgColor
(
this
.
levelData
.
idleColor
);
item
.
setTextColor
(
this
.
levelData
.
idleNumColor
);
item
.
setTextColor
(
this
.
levelData
.
idleNumColor
);
item
.
isSelected
=
false
;
item
.
isSelected
=
false
;
...
@@ -193,7 +203,7 @@ export class NumMatReasonCtr extends Component {
...
@@ -193,7 +203,7 @@ export class NumMatReasonCtr extends Component {
}
}
onEditClick
(
err
:
any
,
flag
:
string
)
{
onEditClick
(
err
:
any
,
flag
:
string
)
{
if
(
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
return
;
if
(
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
return
;
switch
(
flag
)
{
switch
(
flag
)
{
case
"select"
:
case
"select"
:
this
.
gameState
=
GAME_STATE
.
SELECT
;
this
.
gameState
=
GAME_STATE
.
SELECT
;
...
@@ -216,6 +226,23 @@ export class NumMatReasonCtr extends Component {
...
@@ -216,6 +226,23 @@ export class NumMatReasonCtr extends Component {
}
}
}
}
onResetBtnClick
()
{
if
(
this
.
gameState
==
GAME_STATE
.
READY
||
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
{
return
;
}
for
(
let
i
=
0
;
i
<
this
.
itemPosIfoArr
.
length
;
++
i
)
{
if
(
this
.
itemPosIfoArr
[
i
].
xIdx
<
this
.
column
-
1
&&
this
.
itemPosIfoArr
[
i
].
yIdx
<
this
.
row
-
1
)
{
this
.
itemPosIfoArr
[
i
].
target
.
getComponent
(
NumMatItem
)?.
setTextColor
(
this
.
levelData
.
idleNumColor
);
this
.
itemPosIfoArr
[
i
].
target
.
getComponent
(
NumMatItem
)?.
setBgColor
(
this
.
levelData
.
idleColor
);
this
.
itemPosIfoArr
[
i
].
target
.
getComponent
(
NumMatItem
)
!
.
isSelected
=
false
;
}
else
{
this
.
itemPosIfoArr
[
i
].
target
.
getComponent
(
NumMatItem
)?.
setTextColor
(
this
.
levelData
.
wrongNumColor
);
this
.
itemPosIfoArr
[
i
].
target
.
getComponent
(
NumMatItem
)?.
setBgColor
(
this
.
levelData
.
wrongColor
);
}
}
}
update
(
deltaTime
:
number
)
{
update
(
deltaTime
:
number
)
{
// [4]
// [4]
this
.
countdownTime
(
deltaTime
);
this
.
countdownTime
(
deltaTime
);
...
@@ -243,6 +270,7 @@ export class NumMatReasonCtr extends Component {
...
@@ -243,6 +270,7 @@ export class NumMatReasonCtr extends Component {
node
.
setPosition
(
this
.
itemPosIfoArr
[
i
].
pos
);
node
.
setPosition
(
this
.
itemPosIfoArr
[
i
].
pos
);
node
.
getComponent
(
NumMatItem
)?.
setPosIfo
(
this
.
itemPosIfoArr
[
i
]);
node
.
getComponent
(
NumMatItem
)?.
setPosIfo
(
this
.
itemPosIfoArr
[
i
]);
node
.
getComponent
(
NumMatItem
)?.
setText
(
tempNumArr
[
i
].
toString
());
node
.
getComponent
(
NumMatItem
)?.
setText
(
tempNumArr
[
i
].
toString
());
node
.
getComponent
(
NumMatItem
)
!
.
tickSprNode
.
active
=
false
;
if
(
i
==
this
.
itemPosIfoArr
.
length
-
1
)
{
if
(
i
==
this
.
itemPosIfoArr
.
length
-
1
)
{
node
.
active
=
false
;
node
.
active
=
false
;
}
}
...
@@ -322,7 +350,7 @@ export class NumMatReasonCtr extends Component {
...
@@ -322,7 +350,7 @@ export class NumMatReasonCtr extends Component {
//确定是不是已经成功了
//确定是不是已经成功了
checkIsWin
()
{
checkIsWin
()
{
if
(
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
return
;
if
(
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
return
;
for
(
let
r
=
0
;
r
<
this
.
row
-
1
;
++
r
)
{
for
(
let
r
=
0
;
r
<
this
.
row
-
1
;
++
r
)
{
let
items
=
this
.
getRowItems
(
r
);
let
items
=
this
.
getRowItems
(
r
);
let
value
=
0
;
let
value
=
0
;
...
@@ -344,7 +372,7 @@ export class NumMatReasonCtr extends Component {
...
@@ -344,7 +372,7 @@ export class NumMatReasonCtr extends Component {
//把已经正确的行列的颜色换过
//把已经正确的行列的颜色换过
updateItemColor
()
{
updateItemColor
()
{
if
(
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
return
;
if
(
this
.
gameState
==
GAME_STATE
.
END
||
this
.
gameState
==
GAME_STATE
.
PAUSE
)
return
;
for
(
let
r
=
0
;
r
<
this
.
row
-
1
;
++
r
)
{
for
(
let
r
=
0
;
r
<
this
.
row
-
1
;
++
r
)
{
let
items
=
this
.
getRowItems
(
r
);
let
items
=
this
.
getRowItems
(
r
);
let
value
=
0
;
let
value
=
0
;
...
@@ -354,10 +382,12 @@ export class NumMatReasonCtr extends Component {
...
@@ -354,10 +382,12 @@ export class NumMatReasonCtr extends Component {
if
(
value
!=
this
.
numArr
[
r
][
this
.
numArr
[
r
].
length
-
1
])
{
if
(
value
!=
this
.
numArr
[
r
][
this
.
numArr
[
r
].
length
-
1
])
{
items
[
items
.
length
-
1
].
setTextColor
(
this
.
levelData
.
wrongNumColor
);
items
[
items
.
length
-
1
].
setTextColor
(
this
.
levelData
.
wrongNumColor
);
items
[
items
.
length
-
1
].
setBgColor
(
this
.
levelData
.
wrongColor
);
items
[
items
.
length
-
1
].
setBgColor
(
this
.
levelData
.
wrongColor
);
items
[
items
.
length
-
1
].
tickSprNode
.
active
=
false
;
}
}
else
{
else
{
items
[
items
.
length
-
1
].
setTextColor
(
this
.
levelData
.
rightNumColor
);
items
[
items
.
length
-
1
].
setTextColor
(
this
.
levelData
.
rightNumColor
);
items
[
items
.
length
-
1
].
setBgColor
(
this
.
levelData
.
rightColor
);
items
[
items
.
length
-
1
].
setBgColor
(
this
.
levelData
.
rightColor
);
items
[
items
.
length
-
1
].
tickSprNode
.
active
=
true
;
}
}
}
}
for
(
let
c
=
0
;
c
<
this
.
column
-
1
;
++
c
)
{
for
(
let
c
=
0
;
c
<
this
.
column
-
1
;
++
c
)
{
...
@@ -369,10 +399,12 @@ export class NumMatReasonCtr extends Component {
...
@@ -369,10 +399,12 @@ export class NumMatReasonCtr extends Component {
if
(
value
!=
this
.
numArr
[
this
.
numArr
.
length
-
1
][
c
])
{
if
(
value
!=
this
.
numArr
[
this
.
numArr
.
length
-
1
][
c
])
{
items
[
items
.
length
-
1
].
setTextColor
(
this
.
levelData
.
wrongNumColor
);
items
[
items
.
length
-
1
].
setTextColor
(
this
.
levelData
.
wrongNumColor
);
items
[
items
.
length
-
1
].
setBgColor
(
this
.
levelData
.
wrongColor
);
items
[
items
.
length
-
1
].
setBgColor
(
this
.
levelData
.
wrongColor
);
items
[
items
.
length
-
1
].
tickSprNode
.
active
=
false
;
}
}
else
{
else
{
items
[
items
.
length
-
1
].
setTextColor
(
this
.
levelData
.
rightNumColor
);
items
[
items
.
length
-
1
].
setTextColor
(
this
.
levelData
.
rightNumColor
);
items
[
items
.
length
-
1
].
setBgColor
(
this
.
levelData
.
rightColor
);
items
[
items
.
length
-
1
].
setBgColor
(
this
.
levelData
.
rightColor
);
items
[
items
.
length
-
1
].
tickSprNode
.
active
=
true
;
}
}
}
}
}
}
...
...
assets/sceneBundle/games/numMatReason/script/NumMatReasonItem.ts
View file @
d3961078
...
@@ -22,6 +22,9 @@ export class NumMatItem extends Component {
...
@@ -22,6 +22,9 @@ export class NumMatItem extends Component {
@
property
(
Label
)
@
property
(
Label
)
numLab
:
Label
=
null
!
;
numLab
:
Label
=
null
!
;
@
property
(
Node
)
tickSprNode
:
Node
=
null
!
;
private
posIfo
:
ItemPosIfo
=
null
!
;
private
posIfo
:
ItemPosIfo
=
null
!
;
private
_isSelected
=
false
;
private
_isSelected
=
false
;
...
...
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