Commit 85a40717 authored by unknown's avatar unknown

邻接数组好了

parent 849dcd95
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"_prefab": null, "_prefab": null,
"autoReleaseAssets": false, "autoReleaseAssets": false,
"_globals": { "_globals": {
"__id__": 79 "__id__": 95
}, },
"_id": "2125b048-7251-4266-a7f6-5514056e724c" "_id": "2125b048-7251-4266-a7f6-5514056e724c"
}, },
...@@ -213,21 +213,24 @@ ...@@ -213,21 +213,24 @@
}, },
{ {
"__id__": 54 "__id__": 54
},
{
"__id__": 72
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 72 "__id__": 88
}, },
{ {
"__id__": 74 "__id__": 90
}, },
{ {
"__id__": 76 "__id__": 92
}, },
{ {
"__id__": 78 "__id__": 94
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -315,7 +318,7 @@ ...@@ -315,7 +318,7 @@
"_priority": 1073741824, "_priority": 1073741824,
"_fov": 45, "_fov": 45,
"_fovAxis": 0, "_fovAxis": 0,
"_orthoHeight": 411.7, "_orthoHeight": 375,
"_near": 1, "_near": 1,
"_far": 2000, "_far": 2000,
"_color": { "_color": {
...@@ -1933,17 +1936,427 @@ ...@@ -1933,17 +1936,427 @@
"handler": "showGameDescView", "handler": "showGameDescView",
"customEventData": "" "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", "__type__": "cc.UITransform",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 7 "__id__": 73
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__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 "__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": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1334, "width": 1334,
...@@ -1969,7 +2382,7 @@ ...@@ -1969,7 +2382,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 75 "__id__": 91
}, },
"_cameraComponent": { "_cameraComponent": {
"__id__": 9 "__id__": 9
...@@ -1990,7 +2403,7 @@ ...@@ -1990,7 +2403,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 77 "__id__": 93
}, },
"_alignFlags": 45, "_alignFlags": 45,
"_target": null, "_target": null,
...@@ -2051,16 +2464,16 @@ ...@@ -2051,16 +2464,16 @@
{ {
"__type__": "cc.SceneGlobals", "__type__": "cc.SceneGlobals",
"ambient": { "ambient": {
"__id__": 80 "__id__": 96
}, },
"shadows": { "shadows": {
"__id__": 81 "__id__": 97
}, },
"_skybox": { "_skybox": {
"__id__": 82 "__id__": 98
}, },
"fog": { "fog": {
"__id__": 83 "__id__": 99
} }
}, },
{ {
......
...@@ -68,7 +68,7 @@ export class AdjacentArrayCtr extends Component { ...@@ -68,7 +68,7 @@ export class AdjacentArrayCtr extends Component {
private column = 6; private column = 6;
private gridIfoArr: GridIfo[] = []; private gridIfoArr: GridIfo[] = [];
private levelData: number[][] = []; private levelData: number[][] = [];
private level = 0; private level = 1;
private gameState: GAME_STATE = GAME_STATE.READY; private gameState: GAME_STATE = GAME_STATE.READY;
private costTime = 0; private costTime = 0;
...@@ -217,6 +217,18 @@ export class AdjacentArrayCtr extends Component { ...@@ -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() { checkWin() {
let numStrArr: string[] = []; let numStrArr: string[] = [];
for (let i = 0; i < this.gridIfoArr.length; ++i) { for (let i = 0; i < this.gridIfoArr.length; ++i) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment