Commit 912f59e5 authored by 杨一航's avatar 杨一航

fix

parent 3d24d5ed
......@@ -378,7 +378,7 @@
"__id__": 47
},
{
"__id__": 65
"__id__": 63
}
],
"_active": true,
......@@ -2386,15 +2386,12 @@
},
{
"__id__": 60
},
{
"__id__": 62
}
],
"_active": true,
"_components": [
{
"__id__": 64
"__id__": 62
}
],
"_prefab": null,
......@@ -3103,100 +3100,6 @@
"_atlas": null,
"_id": "07QG3MCMBB8LHPdSqJgjS3"
},
{
"__type__": "cc.Node",
"_name": "END",
"_objFlags": 0,
"_parent": {
"__id__": 47
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 63
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 151,
"height": 84
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-146.349,
-346.819,
0,
0,
0,
0,
1,
0.5,
0.5,
0.5
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "43pYokD/tIIaj4+t5D9qdD"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 62
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d167eca7-14b3-407d-9fbf-bc10cc29682f"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b2b8xCOPdOAoKnxrX0keW8"
},
{
"__type__": "cc.Widget",
"_name": "",
......@@ -3233,7 +3136,10 @@
},
"_children": [
{
"__id__": 66
"__id__": 64
},
{
"__id__": 113
},
{
"__id__": 115
......@@ -3297,9 +3203,12 @@
"_name": "wordCards",
"_objFlags": 0,
"_parent": {
"__id__": 65
"__id__": 63
},
"_children": [
{
"__id__": 65
},
{
"__id__": 67
},
......@@ -3368,9 +3277,6 @@
},
{
"__id__": 111
},
{
"__id__": 113
}
],
"_active": true,
......@@ -3428,13 +3334,13 @@
"_name": "1",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 68
"__id__": 66
}
],
"_prefab": null,
......@@ -3490,7 +3396,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 67
"__id__": 65
},
"_enabled": true,
"_materials": [
......@@ -3522,13 +3428,13 @@
"_name": "2",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 70
"__id__": 68
}
],
"_prefab": null,
......@@ -3584,7 +3490,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
"__id__": 67
},
"_enabled": true,
"_materials": [
......@@ -3616,13 +3522,13 @@
"_name": "3",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 72
"__id__": 70
}
],
"_prefab": null,
......@@ -3678,7 +3584,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 71
"__id__": 69
},
"_enabled": true,
"_materials": [
......@@ -3710,13 +3616,13 @@
"_name": "4",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 74
"__id__": 72
}
],
"_prefab": null,
......@@ -3772,7 +3678,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 73
"__id__": 71
},
"_enabled": true,
"_materials": [
......@@ -3804,13 +3710,13 @@
"_name": "5",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 76
"__id__": 74
}
],
"_prefab": null,
......@@ -3866,7 +3772,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 75
"__id__": 73
},
"_enabled": true,
"_materials": [
......@@ -3898,13 +3804,13 @@
"_name": "6",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 78
"__id__": 76
}
],
"_prefab": null,
......@@ -3960,7 +3866,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 77
"__id__": 75
},
"_enabled": true,
"_materials": [
......@@ -3992,13 +3898,13 @@
"_name": "7",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 80
"__id__": 78
}
],
"_prefab": null,
......@@ -4054,7 +3960,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 79
"__id__": 77
},
"_enabled": true,
"_materials": [
......@@ -4086,13 +3992,13 @@
"_name": "8",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 82
"__id__": 80
}
],
"_prefab": null,
......@@ -4148,7 +4054,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 81
"__id__": 79
},
"_enabled": true,
"_materials": [
......@@ -4180,13 +4086,13 @@
"_name": "9",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 84
"__id__": 82
}
],
"_prefab": null,
......@@ -4242,7 +4148,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 83
"__id__": 81
},
"_enabled": true,
"_materials": [
......@@ -4274,13 +4180,13 @@
"_name": "10",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 86
"__id__": 84
}
],
"_prefab": null,
......@@ -4336,7 +4242,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 85
"__id__": 83
},
"_enabled": true,
"_materials": [
......@@ -4368,13 +4274,13 @@
"_name": "11",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 88
"__id__": 86
}
],
"_prefab": null,
......@@ -4430,7 +4336,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 87
"__id__": 85
},
"_enabled": true,
"_materials": [
......@@ -4462,13 +4368,13 @@
"_name": "12",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 90
"__id__": 88
}
],
"_prefab": null,
......@@ -4524,7 +4430,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 89
"__id__": 87
},
"_enabled": true,
"_materials": [
......@@ -4556,13 +4462,13 @@
"_name": "13",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 92
"__id__": 90
}
],
"_prefab": null,
......@@ -4618,7 +4524,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 91
"__id__": 89
},
"_enabled": true,
"_materials": [
......@@ -4650,13 +4556,13 @@
"_name": "14",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 94
"__id__": 92
}
],
"_prefab": null,
......@@ -4712,7 +4618,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 93
"__id__": 91
},
"_enabled": true,
"_materials": [
......@@ -4744,13 +4650,13 @@
"_name": "15",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 96
"__id__": 94
}
],
"_prefab": null,
......@@ -4806,7 +4712,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 95
"__id__": 93
},
"_enabled": true,
"_materials": [
......@@ -4838,13 +4744,13 @@
"_name": "16",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 98
"__id__": 96
}
],
"_prefab": null,
......@@ -4900,7 +4806,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 97
"__id__": 95
},
"_enabled": true,
"_materials": [
......@@ -4932,13 +4838,13 @@
"_name": "17",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 100
"__id__": 98
}
],
"_prefab": null,
......@@ -4994,7 +4900,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 99
"__id__": 97
},
"_enabled": true,
"_materials": [
......@@ -5026,13 +4932,13 @@
"_name": "18",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 102
"__id__": 100
}
],
"_prefab": null,
......@@ -5088,7 +4994,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 101
"__id__": 99
},
"_enabled": true,
"_materials": [
......@@ -5120,13 +5026,13 @@
"_name": "19",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 104
"__id__": 102
}
],
"_prefab": null,
......@@ -5182,7 +5088,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 103
"__id__": 101
},
"_enabled": true,
"_materials": [
......@@ -5214,13 +5120,13 @@
"_name": "20",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 106
"__id__": 104
}
],
"_prefab": null,
......@@ -5276,7 +5182,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 105
"__id__": 103
},
"_enabled": true,
"_materials": [
......@@ -5308,13 +5214,13 @@
"_name": "21",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 108
"__id__": 106
}
],
"_prefab": null,
......@@ -5370,7 +5276,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 107
"__id__": 105
},
"_enabled": true,
"_materials": [
......@@ -5402,13 +5308,13 @@
"_name": "22",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 110
"__id__": 108
}
],
"_prefab": null,
......@@ -5464,7 +5370,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 109
"__id__": 107
},
"_enabled": true,
"_materials": [
......@@ -5496,13 +5402,13 @@
"_name": "23",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 112
"__id__": 110
}
],
"_prefab": null,
......@@ -5558,7 +5464,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 111
"__id__": 109
},
"_enabled": true,
"_materials": [
......@@ -5590,13 +5496,13 @@
"_name": "24",
"_objFlags": 0,
"_parent": {
"__id__": 66
"__id__": 64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 114
"__id__": 112
}
],
"_prefab": null,
......@@ -5652,7 +5558,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 113
"__id__": 111
},
"_enabled": true,
"_materials": [
......@@ -5684,13 +5590,13 @@
"_name": "pieceBlue",
"_objFlags": 0,
"_parent": {
"__id__": 65
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 116
"__id__": 114
}
],
"_prefab": null,
......@@ -5746,7 +5652,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 115
"__id__": 113
},
"_enabled": true,
"_materials": [
......@@ -5778,13 +5684,13 @@
"_name": "pieceRed",
"_objFlags": 0,
"_parent": {
"__id__": 65
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 118
"__id__": 116
}
],
"_prefab": null,
......@@ -5840,7 +5746,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 117
"__id__": 115
},
"_enabled": true,
"_materials": [
......@@ -5867,6 +5773,100 @@
"_atlas": null,
"_id": "74BM4EpfxDH4Oq9oRSTI8H"
},
{
"__type__": "cc.Node",
"_name": "END",
"_objFlags": 0,
"_parent": {
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 118
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 151,
"height": 84
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-292.698,
-693.638,
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": "43pYokD/tIIaj4+t5D9qdD"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 117
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d167eca7-14b3-407d-9fbf-bc10cc29682f"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b2b8xCOPdOAoKnxrX0keW8"
},
{
"__type__": "cc.Sprite",
"_name": "",
......
......@@ -397,6 +397,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
return;
}
this.playLocalAudio("btn");
this.normaltheDice();
this.networkHelper.sendFrame({
type: "roll",
uuid: this.myData.uuid,
......@@ -844,6 +845,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
`Canvas/road/root/piece${this._status.current}`
);
await this.fixStep();
await this.toEnd()
if (this.isMySide) {
this.showWin();
onHomeworkFinish({ isWin: true });
......@@ -856,6 +858,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
}
async toEnd() {
let node = cc.find(`Canvas/road/root/piece${this._status.current}`);
let pos = cc.find(`Canvas/road/root/END`).getPosition();
await asyncTweenTo(
node,
0.7,
{ x: pos.x, y: pos.y },
{ easing: "cubicOut" }
);
await asyncDelay(0.2);
}
showWin() {
let endRoot = cc.find("Canvas/endRoot")
endRoot.active = true;
......@@ -901,6 +918,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (this._isRolling) {
return;
}
const dice = cc.find("Canvas/road/board/runBoard");
return new Promise((resolve, reject) => {
const targetAngle = Math.ceil(dice.angle / 360 + 1) * 360;
......
......@@ -173,10 +173,11 @@ export class GameServer {
let nowStep: number = this.gameStatus[this.gameStatus.current];
console.log("nowStep === " + nowStep);
const jump = this.jumpList.find(jump => parseInt(jump.from) == nowStep + this.gameStatus.step);
this.gameStatus[this.gameStatus.current] = jump ? parseInt(jump.rto) : nowStep + this.gameStatus.step;
this.gameStatus[this.gameStatus.current] = jump?.rto ? parseInt(jump.rto) : nowStep + this.gameStatus.step;
if (jump) {
console.log("jump=============" + jump);
console.log("jump=============");
console.log(jump);
}
if (this.gameStatus[this.gameStatus.current] < this._totalStep - 1) {
this.gameStatus.step = null;
......@@ -203,7 +204,7 @@ export class GameServer {
let nowStep: number = this.gameStatus[this.gameStatus.current];
console.log("nowStep === " + nowStep);
const jump = this.jumpList.find(jump => parseInt(jump.from) == nowStep + this.gameStatus.step);
this.gameStatus[this.gameStatus.current] = jump ? parseInt(jump.wto) : nowStep;
this.gameStatus[this.gameStatus.current] = jump?.wto ? parseInt(jump.wto) : nowStep;
this.gameStatus.step = null;
this.gameStatus.state = 2;
......
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