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
85a40717
Commit
85a40717
authored
Feb 10, 2022
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邻接数组好了
parent
849dcd95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
439 additions
and
14 deletions
+439
-14
AdjacentArray_1.scene
...eneBundle/games/adjacentArray/scene/AdjacentArray_1.scene
+426
-13
AdjacentArrayCtr.ts
...ceneBundle/games/adjacentArray/script/AdjacentArrayCtr.ts
+13
-1
No files found.
assets/sceneBundle/games/adjacentArray/scene/AdjacentArray_1.scene
View file @
85a40717
...
...
@@ -29,7 +29,7 @@
"_prefab": null,
"autoReleaseAssets": false,
"_globals": {
"__id__":
79
"__id__":
95
},
"_id": "2125b048-7251-4266-a7f6-5514056e724c"
},
...
...
@@ -213,21 +213,24 @@
},
{
"__id__": 54
},
{
"__id__": 72
}
],
"_active": true,
"_components": [
{
"__id__":
72
"__id__":
88
},
{
"__id__":
74
"__id__":
90
},
{
"__id__":
76
"__id__":
92
},
{
"__id__":
78
"__id__":
94
}
],
"_prefab": null,
...
...
@@ -315,7 +318,7 @@
"_priority": 1073741824,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight":
411.7
,
"_orthoHeight":
375
,
"_near": 1,
"_far": 2000,
"_color": {
...
...
@@ -1933,17 +1936,427 @@
"handler": "showGameDescView",
"customEventData": ""
},
{
"__type__": "cc.Node",
"_name": "resetBtn",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 73
},
{
"__id__": 78
}
],
"_active": true,
"_components": [
{
"__id__": 83
},
{
"__id__": 85
},
{
"__id__": 87
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 519.364,
"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": "75FrqY37VL9ojc9znMKyrU"
},
{
"__type__": "cc.Node",
"_name": "bgSpr",
"_objFlags": 0,
"_parent": {
"__id__": 72
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 74
},
{
"__id__": 76
}
],
"_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": "d9Qzo8by1COZmBKOTok2Uh"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
"__id__": 7
3
},
"_enabled": true,
"__prefab": {
"__id__": 75
},
"_contentSize": {
"__type__": "cc.Size",
"width": 120,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "36FPkkx4RHw7ZcBfvnXXBJ"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55pCbtzR5GbojKMArZkfim"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 73
},
"_enabled": true,
"__prefab": {
"__id__": 77
},
"_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": "c49fG4ZbNMVIP0aFfC+3a7"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "20UGQn4U9GUoln0NJQTkbG"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"_parent": {
"__id__": 72
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 79
},
{
"__id__": 81
}
],
"_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": "cdeen/WBFNLJGEQThXPlfF"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
},
"_enabled": true,
"__prefab": {
"__id__": 80
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "dag8TQOwxAk4HFlt7xxjIn"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
},
"_enabled": true,
"__prefab": {
"__id__": 82
},
"_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": "24RTVx8qlGM67FxuC9/44S"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
},
"_enabled": true,
"__prefab": {
"__id__": 84
},
"_contentSize": {
"__type__": "cc.Size",
"width": 120,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "4bBw7XLTtNu7T4og1ovjb+"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55pCbtzR5GbojKMArZkfim"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
},
"_enabled": true,
"__prefab": null,
"clickEvents": [
{
"__id__": 86
}
],
"_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": "14L3GdiQFD5ILL8DXtHIs9"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 7
},
"component": "",
"_componentId": "89d77e7UWtKa7FAqNdc14hS",
"handler": "onResetBtnClick",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 36,
"_target": null,
"_left": 0,
"_right": 87.63599999999997,
"_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": "d42il02zZEs49cci7yjZCP"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": {
"__id__": 89
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
...
...
@@ -1969,7 +2382,7 @@
},
"_enabled": true,
"__prefab": {
"__id__":
75
"__id__":
91
},
"_cameraComponent": {
"__id__": 9
...
...
@@ -1990,7 +2403,7 @@
},
"_enabled": true,
"__prefab": {
"__id__":
77
"__id__":
93
},
"_alignFlags": 45,
"_target": null,
...
...
@@ -2051,16 +2464,16 @@
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__":
80
"__id__":
96
},
"shadows": {
"__id__":
81
"__id__":
97
},
"_skybox": {
"__id__":
82
"__id__":
98
},
"fog": {
"__id__":
83
"__id__":
99
}
},
{
...
...
assets/sceneBundle/games/adjacentArray/script/AdjacentArrayCtr.ts
View file @
85a40717
...
...
@@ -68,7 +68,7 @@ export class AdjacentArrayCtr extends Component {
private
column
=
6
;
private
gridIfoArr
:
GridIfo
[]
=
[];
private
levelData
:
number
[][]
=
[];
private
level
=
0
;
private
level
=
1
;
private
gameState
:
GAME_STATE
=
GAME_STATE
.
READY
;
private
costTime
=
0
;
...
...
@@ -217,6 +217,18 @@ export class AdjacentArrayCtr 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
.
gridIfoArr
.
length
;
++
i
){
this
.
gridIfoArr
[
i
].
active
=
false
;
this
.
gridIfoArr
[
i
].
gridItem
.
active
=
false
;
this
.
gridIfoArr
[
i
].
pairItem
[
0
].
target
.
getComponent
(
AdjacentArrayItemCtr
)?.
setBgSprToNor
();
this
.
gridIfoArr
[
i
].
pairItem
[
1
].
target
.
getComponent
(
AdjacentArrayItemCtr
)?.
setBgSprToNor
();
}
}
checkWin
()
{
let
numStrArr
:
string
[]
=
[];
for
(
let
i
=
0
;
i
<
this
.
gridIfoArr
.
length
;
++
i
)
{
...
...
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