Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
op_16
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
op_16
Commits
6eb5ec8c
Commit
6eb5ec8c
authored
Jan 26, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
parent
1155d1ba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
135 additions
and
116 deletions
+135
-116
.DS_Store
.DS_Store
+0
-0
op_16.fire
assets/op_16/scene/op_16.fire
+96
-101
op_16.ts
assets/op_16/scene/op_16.ts
+17
-6
LoadingLayer.ts
assets/op_16/script/LoadingLayer.ts
+1
-1
Server.ts
assets/op_16/script/Server.ts
+21
-8
No files found.
.DS_Store
View file @
6eb5ec8c
No preview for this file type
assets/op_16/scene/op_16.fire
View file @
6eb5ec8c
...
@@ -107,8 +107,8 @@
...
@@ -107,8 +107,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
128
0,
"width":
256
0,
"height":
7
20
"height":
19
20
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -119,8 +119,8 @@
...
@@ -119,8 +119,8 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
64
0,
128
0,
3
60,
9
60,
0,
0,
0,
0,
0,
0,
...
@@ -354,17 +354,21 @@
...
@@ -354,17 +354,21 @@
"__id__": 112
"__id__": 112
},
},
{
{
"__id__": 12
7
"__id__": 12
6
},
},
{
{
"__id__": 14
2
"__id__": 14
1
},
},
{
{
"__id__": 14
9
"__id__": 14
8
}
}
],
],
"_active": true,
"_active": true,
"_components": [],
"_components": [
{
"__id__": 150
}
],
"_prefab": null,
"_prefab": null,
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -4721,10 +4725,10 @@
...
@@ -4721,10 +4725,10 @@
"__id__": 121
"__id__": 121
},
},
{
{
"__id__": 12
3
"__id__": 12
2
},
},
{
{
"__id__": 12
5
"__id__": 12
4
}
}
],
],
"_active": true,
"_active": true,
...
@@ -5158,11 +5162,7 @@
...
@@ -5158,11 +5162,7 @@
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [],
{
"__id__": 122
}
],
"_prefab": null,
"_prefab": null,
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -5211,38 +5211,6 @@
...
@@ -5211,38 +5211,6 @@
"groupIndex": 0,
"groupIndex": 0,
"_id": "0bfyX/nTdPJIpfRKUryv4/"
"_id": "0bfyX/nTdPJIpfRKUryv4/"
},
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 121
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "961b4c40-b93f-4af5-af66-e3683eb2b5b6"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "3eBvzgQ0pNBaDuTKh285uq"
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "faceBlue",
"_name": "faceBlue",
...
@@ -5254,7 +5222,7 @@
...
@@ -5254,7 +5222,7 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 12
4
"__id__": 12
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5310,7 +5278,7 @@
...
@@ -5310,7 +5278,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
3
"__id__": 12
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5348,7 +5316,7 @@
...
@@ -5348,7 +5316,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 12
6
"__id__": 12
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5404,7 +5372,7 @@
...
@@ -5404,7 +5372,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
5
"__id__": 12
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5448,19 +5416,19 @@
...
@@ -5448,19 +5416,19 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 12
8
"__id__": 12
7
},
},
{
{
"__id__": 13
4
"__id__": 13
3
},
},
{
{
"__id__": 13
6
"__id__": 13
5
},
},
{
{
"__id__": 13
8
"__id__": 13
7
},
},
{
{
"__id__": 1
40
"__id__": 1
39
}
}
],
],
"_active": true,
"_active": true,
...
@@ -5518,17 +5486,17 @@
...
@@ -5518,17 +5486,17 @@
"_name": "life_red",
"_name": "life_red",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
7
"__id__": 12
6
},
},
"_children": [
"_children": [
{
{
"__id__": 12
9
"__id__": 12
8
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
3
"__id__": 13
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5584,17 +5552,17 @@
...
@@ -5584,17 +5552,17 @@
"_name": "mask",
"_name": "mask",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
8
"__id__": 12
7
},
},
"_children": [
"_children": [
{
{
"__id__": 1
30
"__id__": 1
29
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
2
"__id__": 13
1
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5650,13 +5618,13 @@
...
@@ -5650,13 +5618,13 @@
"_name": "prograssbar",
"_name": "prograssbar",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
9
"__id__": 12
8
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
1
"__id__": 13
0
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5712,7 +5680,7 @@
...
@@ -5712,7 +5680,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
30
"__id__": 1
29
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5744,7 +5712,7 @@
...
@@ -5744,7 +5712,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
9
"__id__": 12
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5764,7 +5732,7 @@
...
@@ -5764,7 +5732,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
8
"__id__": 12
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5796,13 +5764,13 @@
...
@@ -5796,13 +5764,13 @@
"_name": "dice_bg",
"_name": "dice_bg",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
7
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
5
"__id__": 13
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5858,7 +5826,7 @@
...
@@ -5858,7 +5826,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
4
"__id__": 13
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5890,13 +5858,13 @@
...
@@ -5890,13 +5858,13 @@
"_name": "faceFrame",
"_name": "faceFrame",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
7
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
7
"__id__": 13
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5952,7 +5920,7 @@
...
@@ -5952,7 +5920,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
6
"__id__": 13
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5984,13 +5952,13 @@
...
@@ -5984,13 +5952,13 @@
"_name": "faceRed",
"_name": "faceRed",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
7
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
9
"__id__": 13
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6046,7 +6014,7 @@
...
@@ -6046,7 +6014,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
8
"__id__": 13
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6078,13 +6046,13 @@
...
@@ -6078,13 +6046,13 @@
"_name": "effect",
"_name": "effect",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 12
7
"__id__": 12
6
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 14
1
"__id__": 14
0
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6140,7 +6108,7 @@
...
@@ -6140,7 +6108,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
40
"__id__": 1
39
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6184,13 +6152,13 @@
...
@@ -6184,13 +6152,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 14
3
"__id__": 14
2
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 14
8
"__id__": 14
7
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6246,20 +6214,20 @@
...
@@ -6246,20 +6214,20 @@
"_name": "Background",
"_name": "Background",
"_objFlags": 512,
"_objFlags": 512,
"_parent": {
"_parent": {
"__id__": 14
2
"__id__": 14
1
},
},
"_children": [
"_children": [
{
{
"__id__": 14
4
"__id__": 14
3
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 14
6
"__id__": 14
5
},
},
{
{
"__id__": 14
7
"__id__": 14
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6315,13 +6283,13 @@
...
@@ -6315,13 +6283,13 @@
"_name": "Label",
"_name": "Label",
"_objFlags": 512,
"_objFlags": 512,
"_parent": {
"_parent": {
"__id__": 14
3
"__id__": 14
2
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 14
5
"__id__": 14
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6377,7 +6345,7 @@
...
@@ -6377,7 +6345,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 14
4
"__id__": 14
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6410,7 +6378,7 @@
...
@@ -6410,7 +6378,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 14
3
"__id__": 14
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6442,7 +6410,7 @@
...
@@ -6442,7 +6410,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 14
3
"__id__": 14
2
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 0,
"alignMode": 0,
...
@@ -6469,7 +6437,7 @@
...
@@ -6469,7 +6437,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 14
2
"__id__": 14
1
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -6542,7 +6510,7 @@
...
@@ -6542,7 +6510,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
},
"_N$target": {
"_N$target": {
"__id__": 14
3
"__id__": 14
2
},
},
"_id": "72uh6FFMhPZJXe9I3tJ4Qt"
"_id": "72uh6FFMhPZJXe9I3tJ4Qt"
},
},
...
@@ -6557,7 +6525,7 @@
...
@@ -6557,7 +6525,7 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
50
"__id__": 1
49
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6613,10 +6581,10 @@
...
@@ -6613,10 +6581,10 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 14
9
"__id__": 14
8
},
},
"_enabled": true,
"_enabled": true,
"alignMode":
1
,
"alignMode":
2
,
"_target": null,
"_target": null,
"_alignFlags": 45,
"_alignFlags": 45,
"_left": 0,
"_left": 0,
...
@@ -6635,6 +6603,33 @@
...
@@ -6635,6 +6603,33 @@
"_originalHeight": 0,
"_originalHeight": 0,
"_id": "9fr0grwX5J57n69Cqpwnin"
"_id": "9fr0grwX5J57n69Cqpwnin"
},
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 2560,
"_originalHeight": 1920,
"_id": "17YA8Nu1dLN6R6o3Ie/SyN"
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "endBg",
"_name": "endBg",
...
@@ -6664,8 +6659,8 @@
...
@@ -6664,8 +6659,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
128
0,
"width":
256
0,
"height":
7
20
"height":
19
20
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -6733,8 +6728,8 @@
...
@@ -6733,8 +6728,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
128
0,
"width":
256
0,
"height":
7
20
"height":
19
20
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -7245,8 +7240,8 @@
...
@@ -7245,8 +7240,8 @@
"_enabled": true,
"_enabled": true,
"_designResolution": {
"_designResolution": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
128
0,
"width":
256
0,
"height":
7
20
"height":
19
20
},
},
"_fitWidth": true,
"_fitWidth": true,
"_fitHeight": true,
"_fitHeight": true,
...
...
assets/op_16/scene/op_16.ts
View file @
6eb5ec8c
...
@@ -18,11 +18,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -18,11 +18,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
addPreloadAudio
()
{
addPreloadAudio
()
{
// TODO 根据自己的配置预加载音频资源
// TODO 根据自己的配置预加载音频资源
this
.
_audioResList
.
push
({
url
:
this
.
data
.
gameStartAudio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
gameStartAudio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
gameLoadingAudio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
gameLoadingAudio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
waitingWheel
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
waitingWheel
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
waitingPiece
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
waitingPiece
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
waitingTurn
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
waitingTurn
});
}
}
addPreloadAnima
()
{
addPreloadAnima
()
{
...
@@ -80,6 +80,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -80,6 +80,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
bg
=
cc
.
find
(
'
Canvas/bg
'
);
const
bg
=
cc
.
find
(
'
Canvas/bg
'
);
bg
.
scale
=
Math
.
min
(
canvas
.
width
/
bg
.
width
,
canvas
.
height
/
bg
.
height
);
bg
.
scale
=
Math
.
min
(
canvas
.
width
/
bg
.
width
,
canvas
.
height
/
bg
.
height
);
const
chessBoardBg
=
cc
.
find
(
'
Canvas/bg/chessBoard/bg
'
);
const
offsetX
=
chessBoardBg
.
width
*
chessBoardBg
.
scaleX
/
2
+
(
canvas
.
width
-
chessBoardBg
.
width
*
chessBoardBg
.
scaleX
)
/
4
;
const
lifeblue
=
cc
.
find
(
'
Canvas/bg/Lifeblue
'
);
lifeblue
.
x
=
-
offsetX
;
const
lifered
=
cc
.
find
(
'
Canvas/bg/Lifered
'
);
lifered
.
x
=
offsetX
;
}
}
loadingLayer
;
loadingLayer
;
...
@@ -327,6 +335,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -327,6 +335,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
for
(
let
i
=
startIdx
+
1
;
i
<
board
.
children
.
length
;
i
++
)
{
for
(
let
i
=
startIdx
+
1
;
i
<
board
.
children
.
length
;
i
++
)
{
const
targetNode
=
board
.
children
[
i
];
const
targetNode
=
board
.
children
[
i
];
const
itemData
=
targetNode
.
getComponent
(
'
ItemData
'
);
const
itemData
=
targetNode
.
getComponent
(
'
ItemData
'
);
if
(
itemData
.
letter
.
toLowerCase
()
==
this
.
_status
.
letter
.
toLowerCase
())
{
if
(
itemData
.
letter
.
toLowerCase
()
==
this
.
_status
.
letter
.
toLowerCase
())
{
return
targetNode
;
return
targetNode
;
}
}
...
@@ -539,9 +548,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -539,9 +548,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
console
.
log
(
'
SERVER_playerWin:
'
+
JSON
.
stringify
(
item
.
data
));
console
.
log
(
'
SERVER_playerWin:
'
+
JSON
.
stringify
(
item
.
data
));
const
node
=
cc
.
find
(
`Canvas/bg/chessBoard/piece
${
this
.
_status
.
current
}
`
);
const
node
=
cc
.
find
(
`Canvas/bg/chessBoard/piece
${
this
.
_status
.
current
}
`
);
const
playerMe
=
this
.
allPlayerList
.
find
(
player
=>
player
.
uuid
==
this
.
playerId
);
const
playerMe
=
this
.
allPlayerList
.
find
(
player
=>
player
.
uuid
==
this
.
playerId
);
const
rightBlock
=
this
.
getRightBlock
();
const
board
=
cc
.
find
(
'
Canvas/bg/chessBoard/boardItems
'
);
const
board
=
cc
.
find
(
'
Canvas/bg/chessBoard/boardItems
'
);
const
idx
=
board
.
children
.
length
;
const
idx
=
board
.
children
.
length
;
const
rightBlock
=
board
.
children
[
idx
-
1
];
this
.
pieceFindRightBlock
(
rightBlock
,
idx
);
this
.
pieceFindRightBlock
(
rightBlock
,
idx
);
if
(
playerMe
.
color
==
this
.
_status
.
current
)
{
if
(
playerMe
.
color
==
this
.
_status
.
current
)
{
this
.
showWin
();
this
.
showWin
();
...
...
assets/op_16/script/LoadingLayer.ts
View file @
6eb5ec8c
...
@@ -10,7 +10,7 @@ export default class SceneComponent extends cc.Component {
...
@@ -10,7 +10,7 @@ export default class SceneComponent extends cc.Component {
// 生命周期 onLoad
// 生命周期 onLoad
onLoad
()
{
onLoad
()
{
this
.
initSize
();
//
this.initSize();
}
}
_designSize
;
// 设计分辨率
_designSize
;
// 设计分辨率
...
...
assets/op_16/script/Server.ts
View file @
6eb5ec8c
...
@@ -112,15 +112,25 @@ export class GameServer {
...
@@ -112,15 +112,25 @@ export class GameServer {
}
}
}
else
if
(
data
.
type
==
'
right
'
)
{
}
else
if
(
data
.
type
==
'
right
'
)
{
this
.
gameStatus
[
data
.
color
]
=
data
.
idx
;
this
.
gameStatus
[
data
.
color
]
=
data
.
idx
;
this
.
changeSide
();
const
letterList
=
this
.
getLetterList
();
this
.
networkHelper
.
sendFrame
({
console
.
log
(
'
letterList =
'
+
JSON
.
stringify
(
letterList
));
type
:
'
SERVER_playerRight
'
,
if
(
letterList
.
length
>
0
)
{
idx
:
data
.
idx
,
this
.
changeSide
();
uuid
:
data
.
uuid
,
this
.
networkHelper
.
sendFrame
({
color
:
data
.
color
type
:
'
SERVER_playerRight
'
,
});
idx
:
data
.
idx
,
uuid
:
data
.
uuid
,
color
:
data
.
color
});
}
else
{
this
.
networkHelper
.
sendFrame
({
type
:
'
SERVER_playerWin
'
,
color
:
this
.
gameStatus
.
current
});
}
}
else
if
(
data
.
type
==
'
wrong
'
)
{
}
else
if
(
data
.
type
==
'
wrong
'
)
{
this
.
gameStatus
[
data
.
color
]
=
data
.
idx
;
console
.
log
(
'
data =
'
+
JSON
.
stringify
(
data
));
// this.gameStatus[data.color] = data.idx;
this
.
changeSide
();
this
.
changeSide
();
this
.
networkHelper
.
sendFrame
({
this
.
networkHelper
.
sendFrame
({
type
:
'
SERVER_playerWrong
'
,
type
:
'
SERVER_playerWrong
'
,
...
@@ -137,7 +147,10 @@ export class GameServer {
...
@@ -137,7 +147,10 @@ export class GameServer {
getLetterList
()
{
getLetterList
()
{
const
board
=
cc
.
find
(
'
Canvas/bg/chessBoard/boardItems
'
);
const
board
=
cc
.
find
(
'
Canvas/bg/chessBoard/boardItems
'
);
const
color
=
this
.
gameStatus
.
current
;
const
color
=
this
.
gameStatus
.
current
;
console
.
log
(
"
color =
"
+
color
);
console
.
log
(
'
this.gameStatus =
'
+
JSON
.
stringify
(
this
.
gameStatus
));
const
startIdx
=
this
.
gameStatus
[
color
];
const
startIdx
=
this
.
gameStatus
[
color
];
console
.
log
(
'
startIdx =
'
+
startIdx
);
const
letterList
=
[];
const
letterList
=
[];
for
(
let
i
=
startIdx
+
1
;
i
<
board
.
children
.
length
;
i
++
)
{
for
(
let
i
=
startIdx
+
1
;
i
<
board
.
children
.
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