Misc fixes for UI alignments.

This commit is contained in:
genxium 2023-01-18 10:06:27 +08:00
parent 342efc623c
commit 48074d48af
20 changed files with 3527 additions and 9146 deletions

View File

@ -781,7 +781,7 @@ func (pR *Room) OnDismissed() {
pR.BattleDurationFrames = int32(60 * serverFps)
pR.BattleDurationNanos = int64(pR.BattleDurationFrames) * (pR.RollbackEstimatedDtNanos + 1)
pR.InputFrameUpsyncDelayTolerance = battle.ConvertToNoDelayInputFrameId(pR.NstDelayFrames) - 1 // this value should be strictly smaller than (NstDelayFrames >> InputScaleFrames), otherwise "type#1 forceConfirmation" might become a lag avalanche
pR.MaxChasingRenderFramesPerUpdate = 12 // Don't set this value too high to avoid exhausting frontend CPU within a single frame
pR.MaxChasingRenderFramesPerUpdate = 4 // Don't set this value too high to avoid exhausting frontend CPU within a single frame
pR.BackendDynamicsEnabled = true // [WARNING] When "false", recovery upon reconnection wouldn't work!
pR.ForceAllResyncOnAnyActiveSlowTicker = true // See tradeoff discussion in "downsyncToAllPlayers"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
{
"ver": "1.0.1",
"uuid": "5a2059cd-f691-4ffa-bdc9-7e1232295450",
"subMetas": {}
}

View File

@ -28,19 +28,19 @@
},
{
"__id__": 11
},
{
"__id__": 14
}
],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 15
"__id__": 17
}
],
"_prefab": {
"__id__": 16
"__id__": 18
},
"_opacity": 255,
"_color": {
@ -91,7 +91,7 @@
},
{
"__type__": "cc.Node",
"_name": "WhiteStars",
"_name": "Background",
"_objFlags": 0,
"_parent": {
"__id__": 1
@ -109,15 +109,15 @@
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"r": 0,
"g": 163,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 268,
"height": 112
"width": 1920,
"height": 1280
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -128,7 +128,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-16,
0,
0,
0,
0,
@ -169,10 +169,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "1a2d934e-9d6d-45bf-83c6-564586cc8400"
"__uuid__": "637f31c2-c53e-4dec-ae11-d56c0c6177ad"
},
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
@ -195,7 +195,7 @@
"asset": {
"__uuid__": "230eeb1f-e0f9-4a41-ab6c-05b3771cbf3e"
},
"fileId": "50Mjaee6xFXLrZ/mSBD3P5",
"fileId": "83iQr+5XNNF5E2qjV+WUp0",
"sync": false
},
{
@ -522,16 +522,67 @@
"sync": false
},
{
"__type__": "6a3d6Y6Ki1BiqAVSKIRdwRl",
"_name": "",
"__type__": "cc.Node",
"_name": "WhiteStars",
"_objFlags": 0,
"node": {
"_parent": {
"__id__": 1
},
"_enabled": true,
"countdownSeconds": {
"__id__": 9
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
}
],
"_prefab": {
"__id__": 16
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 268,
"height": 112
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-16,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
@ -539,7 +590,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
"__id__": 14
},
"_enabled": true,
"_materials": [
@ -550,10 +601,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "637f31c2-c53e-4dec-ae11-d56c0c6177ad"
"__uuid__": "1a2d934e-9d6d-45bf-83c6-564586cc8400"
},
"_type": 0,
"_sizeMode": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
@ -568,6 +619,30 @@
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "230eeb1f-e0f9-4a41-ab6c-05b3771cbf3e"
},
"fileId": "50Mjaee6xFXLrZ/mSBD3P5",
"sync": false
},
{
"__type__": "6a3d6Y6Ki1BiqAVSKIRdwRl",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"countdownSeconds": {
"__id__": 9
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"ver": "1.2.5",
"uuid": "3ed4c7bc-79d0-4075-a563-d5a58ae798f9",
"uuid": "dc804c5c-ff76-445e-ac69-52269055c3c5",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,

View File

@ -21,20 +21,20 @@
"__id__": 2
},
{
"__id__": 10
"__id__": 5
}
],
"_active": true,
"_components": [
{
"__id__": 13
"__id__": 12
},
{
"__id__": 14
"__id__": 13
}
],
"_prefab": {
"__id__": 15
"__id__": 14
},
"_opacity": 255,
"_color": {
@ -54,6 +54,70 @@
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
480,
320,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Background",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1280
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
@ -83,6 +147,51 @@
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "637f31c2-c53e-4dec-ae11-d56c0c6177ad"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109"
},
"fileId": "a7oR1cZvVO/pp9QJgLnJyt",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "modeButton",
@ -92,20 +201,20 @@
},
"_children": [
{
"__id__": 3
"__id__": 6
}
],
"_active": true,
"_components": [
{
"__id__": 7
"__id__": 9
},
{
"__id__": 8
"__id__": 10
}
],
"_prefab": {
"__id__": 9
"__id__": 11
},
"_opacity": 255,
"_color": {
@ -117,8 +226,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 280,
"height": 130
"width": 240,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -130,7 +239,7 @@
"ctor": "Float64Array",
"array": [
0,
-142.555,
-90.495,
0,
0,
0,
@ -159,20 +268,17 @@
"_name": "Label",
"_objFlags": 0,
"_parent": {
"__id__": 2
"__id__": 5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
},
{
"__id__": 5
"__id__": 7
}
],
"_prefab": {
"__id__": 6
"__id__": 8
},
"_opacity": 255,
"_color": {
@ -226,7 +332,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
"__id__": 6
},
"_enabled": true,
"_materials": [
@ -235,8 +341,8 @@
}
],
"_useOriginalSize": false,
"_string": "gameRule.mode",
"_N$string": "gameRule.mode",
"_string": "1 v 1",
"_N$string": "1 v 1",
"_fontSize": 55,
"_lineHeight": 50,
"_enableWrapText": false,
@ -251,17 +357,6 @@
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "744dcs4DCdNprNhG0xwq6FK",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_dataID": "gameRule.mode",
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
@ -278,7 +373,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 5
},
"_enabled": true,
"_materials": [
@ -312,7 +407,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 5
},
"_enabled": true,
"_normalMaterial": null,
@ -375,7 +470,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 2
"__id__": 5
},
"_id": ""
},
@ -390,115 +485,6 @@
"fileId": "c54lqSflFD8ogSYAhsAkKh",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "decoration",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
}
],
"_prefab": {
"__id__": 12
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 543,
"height": 117
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
178.253,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "153d890a-fc37-4d59-8779-93a8fb19fa85"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109"
},
"fileId": "1bbMLAzntHZpEudL8lM/Lx",
"sync": false
},
{
"__type__": "dd92bKVy8FJY7uq3ieoNZCZ",
"_name": "",
@ -508,43 +494,36 @@
},
"_enabled": true,
"modeButton": {
"__id__": 8
"__id__": 10
},
"mapNode": null,
"_id": ""
},
{
"__type__": "cc.Sprite",
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "637f31c2-c53e-4dec-ae11-d56c0c6177ad"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"alignMode": 1,
"_target": null,
"_alignFlags": 18,
"_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": 0,
"_originalHeight": 0,
"_id": ""
},
{

View File

@ -8,7 +8,8 @@
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
@ -20,18 +21,17 @@
"__id__": 2
},
{
"__id__": 6
"__id__": 5
}
],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 9
"__id__": 8
}
],
"_prefab": {
"__id__": 10
"__id__": 9
},
"_opacity": 255,
"_color": {
@ -51,24 +51,12 @@
"x": 0.5,
"y": 0.5
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"_zIndex": 0,
"groupIndex": 0,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
512,
0,
480,
480,
0,
0,
0,
@ -78,7 +66,19 @@
1,
1
]
}
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
@ -89,17 +89,13 @@
},
"_children": [],
"_active": true,
"_level": 0,
"_components": [
{
"__id__": 3
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
"__id__": 4
},
"_opacity": 255,
"_color": {
@ -111,32 +107,20 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 303.5,
"height": 30
"width": 805.7,
"height": 35.28
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"_zIndex": 0,
"groupIndex": 0,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
210,
-150,
0,
0,
0,
@ -146,7 +130,19 @@
1,
1
]
}
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Label",
@ -156,32 +152,26 @@
"__id__": 2
},
"_enabled": true,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "login.tips.loginSuccess",
"_N$string": "login.tips.loginSuccess",
"_fontSize": 30,
"_lineHeight": 30,
"_string": "Logged in successfully, loading game resources...",
"_N$string": "Logged in successfully, loading game resources...",
"_fontSize": 28,
"_lineHeight": 28,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_id": ""
},
{
"__type__": "744dcs4DCdNprNhG0xwq6FK",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_dataID": "login.tips.loginSuccess",
"_N$overflow": 3,
"_N$cacheMode": 0,
"_id": ""
},
{
@ -204,14 +194,13 @@
},
"_children": [],
"_active": true,
"_level": 0,
"_components": [
{
"__id__": 7
"__id__": 6
}
],
"_prefab": {
"__id__": 8
"__id__": 7
},
"_opacity": 255,
"_color": {
@ -231,24 +220,12 @@
"x": 0.5,
"y": 0.5
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"_zIndex": 0,
"groupIndex": 0,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
333,
0,
0,
0,
0,
@ -258,16 +235,29 @@
1,
1
]
}
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
"__id__": 5
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
@ -282,7 +272,6 @@
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": null,
"_id": ""
},
@ -307,7 +296,7 @@
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 20,
"_alignFlags": 18,
"_left": 0,
"_right": 0,
"_top": 0,

File diff suppressed because it is too large Load Diff

View File

@ -72,17 +72,11 @@
"__id__": 3
},
{
"__id__": 8
"__id__": 9
}
],
"_active": true,
"_components": [
{
"__id__": 38
},
{
"__id__": 39
},
{
"__id__": 40
},
@ -91,6 +85,12 @@
},
{
"__id__": 42
},
{
"__id__": 43
},
{
"__id__": 44
}
],
"_prefab": null,
@ -158,7 +158,7 @@
"__id__": 5
},
{
"__id__": 37
"__id__": 39
}
],
"_prefab": null,
@ -247,10 +247,10 @@
"__uuid__": "670b477e-61a1-4778-879b-35913f7c79d2"
},
"boundRoomIdLabel": {
"__id__": 15
"__id__": 16
},
"countdownLabel": {
"__id__": 21
"__id__": 23
},
"resultPanelPrefab": {
"__uuid__": "c4cfe3bd-c59e-4d5b-95cb-c933b120e184"
@ -259,7 +259,7 @@
"__uuid__": "32b8e752-8362-4783-a4a6-1160af8b7109"
},
"findingPlayerPrefab": {
"__uuid__": "3ed4c7bc-79d0-4075-a563-d5a58ae798f9"
"__uuid__": "dc804c5c-ff76-445e-ac69-52269055c3c5"
},
"countdownToBeginGamePrefab": {
"__uuid__": "230eeb1f-e0f9-4a41-ab6c-05b3771cbf3e"
@ -283,13 +283,13 @@
},
"_children": [
{
"__id__": 31
"__id__": 33
}
],
"_active": true,
"_components": [
{
"__id__": 36
"__id__": 38
}
],
"_prefab": null,
@ -316,7 +316,7 @@
"ctor": "Float64Array",
"array": [
-199.439,
-194.735,
-172.557,
0,
0,
0,
@ -324,7 +324,7 @@
1,
0.4,
0.4,
1
0.4
]
},
"_eulerAngles": {
@ -342,32 +342,29 @@
},
{
"__type__": "cc.Node",
"_name": "WidgetsAboveAll",
"_name": "Interactive",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [
{
"__id__": 10
},
{
"__id__": 6
},
{
"__id__": 20
},
{
"__id__": 22
},
{
"__id__": 26
"__id__": 24
},
{
"__id__": 28
}
],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 32
}
],
"_prefab": null,
@ -416,6 +413,75 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bb5Zj3NPxJgrEYDllBW7Gj"
},
{
"__type__": "cc.Node",
"_name": "WidgetsAboveAll",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [
{
"__id__": 11
},
{
"__id__": 7
}
],
"_active": true,
"_components": [
{
"__id__": 21
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 1280
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c6fPdAUURDX69j0zTeIFZv"
},
{
@ -427,13 +493,13 @@
},
"_children": [
{
"__id__": 7
"__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 9
"__id__": 10
}
],
"_prefab": null,
@ -461,7 +527,7 @@
"array": [
0,
0,
210.4394431281402,
209.57814771583418,
0,
0,
0,
@ -489,7 +555,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
"__id__": 9
},
"_enabled": true,
"_cullingMask": 4294967295,
@ -525,20 +591,20 @@
"_name": "DebugInfo",
"_objFlags": 0,
"_parent": {
"__id__": 7
"__id__": 8
},
"_children": [
{
"__id__": 11
"__id__": 12
}
],
"_active": true,
"_components": [
{
"__id__": 18
"__id__": 19
},
{
"__id__": 19
"__id__": 20
}
],
"_prefab": null,
@ -594,23 +660,23 @@
"_name": "RoomIdIndicator",
"_objFlags": 0,
"_parent": {
"__id__": 10
"__id__": 11
},
"_children": [
{
"__id__": 12
"__id__": 13
},
{
"__id__": 14
"__id__": 15
}
],
"_active": false,
"_components": [
{
"__id__": 16
"__id__": 17
},
{
"__id__": 17
"__id__": 18
}
],
"_prefab": null,
@ -666,13 +732,13 @@
"_name": "label",
"_objFlags": 0,
"_parent": {
"__id__": 11
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
"__id__": 14
}
],
"_prefab": null,
@ -728,7 +794,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 13
},
"_enabled": true,
"_materials": [],
@ -756,13 +822,13 @@
"_name": "BoundRoomIdLabel",
"_objFlags": 0,
"_parent": {
"__id__": 11
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
"__id__": 16
}
],
"_prefab": null,
@ -818,7 +884,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
"__id__": 15
},
"_enabled": true,
"_materials": [],
@ -846,7 +912,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
"__id__": 12
},
"_enabled": true,
"_layoutSize": {
@ -879,7 +945,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
"__id__": 12
},
"_enabled": true,
"_materials": [],
@ -909,7 +975,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
"__id__": 11
},
"_enabled": true,
"_materials": [],
@ -935,7 +1001,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
"__id__": 11
},
"_enabled": true,
"_layoutSize": {
@ -963,6 +1029,33 @@
"_N$affectedByScale": false,
"_id": "f6GkgYwn9JvKLqbGG1zmeD"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 18,
"_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": 0,
"_originalHeight": 0,
"_id": "aenJ9ZDDRKDoS7u5MxeZOb"
},
{
"__type__": "cc.Node",
"_name": "CountdownSeconds",
@ -974,7 +1067,7 @@
"_active": true,
"_components": [
{
"__id__": 21
"__id__": 23
}
],
"_prefab": null,
@ -1001,7 +1094,7 @@
"ctor": "Float64Array",
"array": [
0,
168.421,
181.094,
0,
0,
0,
@ -1030,7 +1123,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
"__id__": 22
},
"_enabled": true,
"_materials": [
@ -1064,7 +1157,7 @@
},
"_children": [
{
"__id__": 23
"__id__": 25
}
],
"_active": true,
@ -1093,7 +1186,7 @@
"ctor": "Float64Array",
"array": [
178,
-217.627,
-179.607,
0,
0,
0,
@ -1101,7 +1194,7 @@
1,
0.5,
0.5,
1
0.5
]
},
"_eulerAngles": {
@ -1122,16 +1215,16 @@
"_name": "Background",
"_objFlags": 0,
"_parent": {
"__id__": 22
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 24
"__id__": 26
},
{
"__id__": 25
"__id__": 27
}
],
"_prefab": null,
@ -1187,7 +1280,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 25
},
"_enabled": true,
"_materials": [
@ -1221,7 +1314,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 25
},
"_enabled": true,
"alignMode": 0,
@ -1252,7 +1345,7 @@
},
"_children": [
{
"__id__": 27
"__id__": 29
}
],
"_active": true,
@ -1281,7 +1374,7 @@
"ctor": "Float64Array",
"array": [
395,
-155.562,
-123.879,
0,
0,
0,
@ -1289,7 +1382,7 @@
1,
0.5,
0.5,
1
0.5
]
},
"_eulerAngles": {
@ -1310,16 +1403,16 @@
"_name": "Background",
"_objFlags": 0,
"_parent": {
"__id__": 26
"__id__": 28
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 28
"__id__": 30
},
{
"__id__": 29
"__id__": 31
}
],
"_prefab": null,
@ -1375,7 +1468,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 27
"__id__": 29
},
"_enabled": true,
"_materials": [
@ -1409,7 +1502,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 27
"__id__": 29
},
"_enabled": true,
"alignMode": 0,
@ -1441,11 +1534,11 @@
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 0,
"_alignFlags": 20,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_bottom": 640,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
@ -1456,7 +1549,7 @@
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "aenJ9ZDDRKDoS7u5MxeZOb"
"_id": "60S5//1JxMULAtkfxKep87"
},
{
"__type__": "cc.Node",
@ -1467,16 +1560,16 @@
},
"_children": [
{
"__id__": 32
"__id__": 34
}
],
"_active": true,
"_components": [
{
"__id__": 34
"__id__": 36
},
{
"__id__": 35
"__id__": 37
}
],
"_prefab": null,
@ -1532,13 +1625,13 @@
"_name": "Joystick",
"_objFlags": 0,
"_parent": {
"__id__": 31
"__id__": 33
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 33
"__id__": 35
}
],
"_prefab": null,
@ -1594,7 +1687,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
"__id__": 34
},
"_enabled": true,
"_materials": [
@ -1628,7 +1721,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
"__id__": 33
},
"_enabled": true,
"_materials": [
@ -1662,7 +1755,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
"__id__": 33
},
"_enabled": true,
"alignMode": 0,
@ -1719,21 +1812,11 @@
"__id__": 3
},
"_enabled": true,
"BGMEffect": {
"__uuid__": "64a79efa-97de-4cb5-b2a9-01500c60573a"
},
"crashedByTrapBullet": {
"__uuid__": "1d604e42-8cee-466f-884d-e74cae21ce3b"
},
"highScoreTreasurePicked": {
"__uuid__": "0164d22c-d965-461f-867e-b30e2d56cc5c"
},
"treasurePicked": {
"__uuid__": "7704b97e-6367-420c-b7af-d0750a2bbb30"
},
"countDown10SecToEnd": {
"__uuid__": "261d1d7d-a5cc-4cb7-a737-194427055fd4"
},
"BGMEffect": null,
"crashedByTrapBullet": null,
"highScoreTreasurePicked": null,
"treasurePicked": null,
"countDown10SecToEnd": null,
"mapNode": {
"__id__": 3
},
@ -1791,9 +1874,9 @@
"__id__": 2
},
"_enabled": true,
"alignMode": 0,
"alignMode": 1,
"_target": null,
"_alignFlags": 0,
"_alignFlags": 18,
"_left": 6240,
"_right": -4000,
"_top": -8320,
@ -1825,10 +1908,10 @@
"__id__": 3
},
"stickhead": {
"__id__": 32
"__id__": 34
},
"base": {
"__id__": 31
"__id__": 33
},
"joyStickEps": 0.1,
"magicLeanLowerBound": 0.414,
@ -1849,10 +1932,10 @@
"linearMovingEps": 0.1,
"scaleByEps": 0.0375,
"btnA": {
"__id__": 22
"__id__": 24
},
"btnB": {
"__id__": 26
"__id__": 28
},
"_id": "e9oVYTr7ROlpp/IrNjBUmR"
}

View File

@ -102,7 +102,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 480
"height": 960
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -114,7 +114,7 @@
"ctor": "Float64Array",
"array": [
480,
240,
480,
0,
0,
0,
@ -362,7 +362,7 @@
"array": [
0,
0,
210.4394431281402,
209.57814771583418,
0,
0,
0,
@ -451,7 +451,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 480
"height": 960
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -2809,10 +2809,10 @@
"_designResolution": {
"__type__": "cc.Size",
"width": 960,
"height": 480
"height": 960
},
"_fitWidth": false,
"_fitHeight": true,
"_fitWidth": true,
"_fitHeight": false,
"_id": "45irrwnU1MAaF3kwQFnJ++"
},
{
@ -2823,7 +2823,7 @@
"__id__": 2
},
"_enabled": true,
"alignMode": 0,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,

File diff suppressed because it is too large Load Diff

View File

@ -14,10 +14,6 @@ cc.Class({
type: cc.Node,
default: null
},
myAvatarNode: {
type: cc.Node,
default: null
},
exitBtnNode: {
type: cc.Node,
default: null
@ -25,8 +21,7 @@ cc.Class({
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
},
onLoad() {},
init() {
if (null != this.firstPlayerInfoNode) {
@ -79,20 +74,11 @@ cc.Class({
}
}
//显示自己的头像名称以及他人的头像名称
for (let i in playerMetas) {
const playerMeta = playerMetas[i];
console.log("Showing playerMeta:", playerMeta);
const playerInfoNode = this.playersInfoNode[playerMeta.joinIndex];
(() => { //远程加载头像
let remoteUrl = playerMeta.avatar;
if (remoteUrl == null || remoteUrl == '') {
cc.log(`No avatar to show for :`);
cc.log(playerMeta);
}
})();
function isEmptyString(str) {
return str == null || str == ''
}

View File

@ -68,7 +68,7 @@ cc.Class({
// LIFE-CYCLE CALLBACKS:
onLoad() {
cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
cc.view.setOrientation(cc.macro.ORIENTATION_AUTO);
cc.view.enableAutoFullScreen(true);
window.atFirstLocationHref = window.location.href.split('#')[0];

View File

@ -476,7 +476,6 @@ cc.Class({
console.log(`Received parsedBattleColliderInfo via ws`);
// TODO: Upon reconnection, the backend might have already been sending down data that'd trigger "onRoomDownsyncFrame & onInputFrameDownsyncBatch", but frontend could reject those data due to "battleState != PlayerBattleState.ACTIVE".
Object.assign(self, parsedBattleColliderInfo);
self.tooFastDtIntervalMillis = 0.5 * self.rollbackEstimatedDtMillis;
const tiledMapIns = self.node.getComponent(cc.TiledMap);
@ -911,12 +910,13 @@ batchInputFrameIdRange=[${batch[0].inputFrameId}, ${batch[batch.length - 1].inpu
update(dt) {
const self = this;
if (ALL_BATTLE_STATES.IN_BATTLE == self.battleState) {
const elapsedMillisSinceLastFrameIdTriggered = performance.now() - self.lastRenderFrameIdTriggeredAt;
if (elapsedMillisSinceLastFrameIdTriggered < self.tooFastDtIntervalMillis) {
// [WARNING] We should avoid a frontend ticking too fast to prevent cheating, as well as ticking too slow to cause a "resync avalanche" that impacts user experience!
// console.debug("Avoiding too fast frame@renderFrameId=", self.renderFrameId, ": elapsedMillisSinceLastFrameIdTriggered=", elapsedMillisSinceLastFrameIdTriggered);
//return;
}
/*
[WARNING] Different devices might differ in the rate of calling "update(dt)", and the game engine is responsible of keeping this rate statistically constant.
Significantly different rates of calling "update(dt)" among players in a same battle would result in frequent [type#1 forceConfirmation], if you have any doubt on troubles caused by this, sample the FPS curve from all players in that battle.
Kindly note that Significantly different network bandwidths or delay fluctuations would result in frequent [type#1 forceConfirmation] too, but CAUSE FROM DIFFERENT LOCAL "update(dt)" RATE SHOULD BE THE FIRST TO INVESTIGATE AND ELIMINATE -- because we have control on it, but no one has control on the internet.
*/
try {
let st = performance.now();
const noDelayInputFrameId = gopkgs.ConvertToNoDelayInputFrameId(self.renderFrameId);

View File

@ -11,14 +11,6 @@ cc.Class({
type: cc.Object,
default: null
},
myAvatarNode: {
type: cc.Node,
default: null,
},
myNameNode: {
type: cc.Node,
default: null,
},
rankingNodes: {
type: [cc.Node],
default: [],
@ -46,22 +38,6 @@ cc.Class({
showPlayerInfo(playerRichInfoDict) {
this.showRanking(playerRichInfoDict);
this.showMyAvatar();
this.showMyName();
},
showMyName() {
const selfPlayerInfo = JSON.parse(cc.sys.localStorage.getItem('selfPlayer'));
let name = 'No name';
if (null == selfPlayerInfo.displayName || "" == selfPlayerInfo.displayName) {
name = selfPlayerInfo.name;
} else {
name = selfPlayerInfo.displayName;
}
if (!this.myNameNode) return;
const myNameNodeLabel = this.myNameNode.getComponent(cc.Label);
if (!myNameNodeLabel || null == name) return;
myNameNodeLabel.string = name;
},
showRanking(playerRichInfoDict) {
@ -115,42 +91,6 @@ cc.Class({
}
},
showMyAvatar() {
const self = this;
const selfPlayerInfo = JSON.parse(cc.sys.localStorage.getItem('selfPlayer'));
let remoteUrl = selfPlayerInfo.avatar;
if (remoteUrl == null || remoteUrl == '') {
cc.log(`No avatar to show for myself, check storage.`);
return;
} else {
cc.loader.load({
url: remoteUrl,
type: 'jpg'
}, function(err, texture) {
if (err != null || texture == null) {
console.log(err);
} else {
const sf = new cc.SpriteFrame();
sf.setTexture(texture);
self.myAvatarNode.getComponent(cc.Sprite).spriteFrame = sf;
}
});
}
},
showRibbon(winnerInfo, ribbonNode) {
const selfPlayerInfo = JSON.parse(cc.sys.localStorage.getItem('selfPlayer'));
const texture = (selfPlayerInfo.playerId == winnerInfo.id) ? "textures/resultPanel/WinRibbon" : "textures/resultPanel/loseRibbon";
cc.loader.loadRes(texture, cc.SpriteFrame, function(err, spriteFrame) {
if (err) {
console.log(err);
return;
}
ribbonNode.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
},
onClose(evt) {
if (this.node.parent) {
this.node.parent.removeChild(this.node);

View File

@ -6,16 +6,22 @@ all: help
GOPROXY=https://goproxy.io
serve:
gopherjs clean
gopherjs serve $(PROJECTNAME)
build:
gopherjs build $(PROJECTNAME)
rm ../frontend/assets/plugin_scripts/jsexport.js && mv ./jsexport.js ../frontend/assets/plugin_scripts/jsexport.js
clean:
gopherjs clean
rm -f ../frontend/assets/plugin_scripts/jsexport.js
rm -f ../frontend/assets/plugin_scripts/jsexport.js.map
build-min:
build: clean
gopherjs build $(PROJECTNAME)
mv ./jsexport.js ../frontend/assets/plugin_scripts/
mv ./jsexport.js.map ../frontend/assets/plugin_scripts/
build-min: clean
gopherjs build -m $(PROJECTNAME)
rm ../frontend/assets/plugin_scripts/jsexport.js && mv ./jsexport.js ../frontend/assets/plugin_scripts/jsexport.js
mv ./jsexport.js ../frontend/assets/plugin_scripts/
mv ./jsexport.js.map ../frontend/assets/plugin_scripts/
.PHONY: help

View File

@ -22,7 +22,7 @@ const (
GRAVITY_X = int32(0)
GRAVITY_Y = -int32(float64(0.5) * WORLD_TO_VIRTUAL_GRID_RATIO) // makes all "playerCollider.Y" a multiple of 0.5 in all cases
INPUT_DELAY_FRAMES = int32(4) // in the count of render frames
INPUT_DELAY_FRAMES = int32(8) // in the count of render frames
INPUT_SCALE_FRAMES = uint32(2) // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames)
NST_DELAY_FRAMES = int32(16) // network-single-trip delay in the count of render frames, proposed to be (InputDelayFrames >> 1) because we expect a round-trip delay to be exactly "InputDelayFrames"
@ -489,19 +489,19 @@ func deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame *PlayerDownsync,
}
patternId := PATTERN_ID_NO_OP
if 0 < decodedInput.BtnALevel {
if decodedInput.BtnALevel > prevBtnALevel {
if 0 > effDy {
patternId = 3
} else if 0 < effDy {
patternId = 2
} else {
patternId = 1
}
} else {
patternId = 4 // Holding
}
}
if 0 < decodedInput.BtnALevel {
if decodedInput.BtnALevel > prevBtnALevel {
if 0 > effDy {
patternId = 3
} else if 0 < effDy {
patternId = 2
} else {
patternId = 1
}
} else {
patternId = 4 // Holding
}
}
return patternId, jumpedOrNot, effDx, effDy
}

View File

@ -42,7 +42,7 @@ var Characters = map[int]*CharacterConfig{
GetUpInvinsibleFrames: int32(10),
GetUpFramesToRecover: int32(27),
Speed: int32(float64(3.0) * WORLD_TO_VIRTUAL_GRID_RATIO),
Speed: int32(float64(2.0) * WORLD_TO_VIRTUAL_GRID_RATIO),
JumpingInitVelY: int32(float64(8) * WORLD_TO_VIRTUAL_GRID_RATIO),
DashingEnabled: false,
@ -88,7 +88,7 @@ var Characters = map[int]*CharacterConfig{
GetUpInvinsibleFrames: int32(10),
GetUpFramesToRecover: int32(27),
Speed: int32(float64(4.0) * WORLD_TO_VIRTUAL_GRID_RATIO),
Speed: int32(float64(2.0) * WORLD_TO_VIRTUAL_GRID_RATIO),
JumpingInitVelY: int32(float64(7.5) * WORLD_TO_VIRTUAL_GRID_RATIO),
DashingEnabled: true,
@ -138,7 +138,7 @@ var Characters = map[int]*CharacterConfig{
GetUpInvinsibleFrames: int32(8),
GetUpFramesToRecover: int32(30),
Speed: int32(float64(3.0) * WORLD_TO_VIRTUAL_GRID_RATIO),
Speed: int32(float64(1.9) * WORLD_TO_VIRTUAL_GRID_RATIO),
JumpingInitVelY: int32(float64(7.5) * WORLD_TO_VIRTUAL_GRID_RATIO),
DashingEnabled: false,