[update]新增骰子计数

游标移动时,剩余步数增加倒计时
This commit is contained in:
2026-04-27 15:42:42 +08:00
parent e25211c79a
commit 2e4674c3c1
2 changed files with 359 additions and 34 deletions

View File

@@ -53,22 +53,25 @@
}, },
{ {
"__id__": 1624 "__id__": 1624
},
{
"__id__": 1636
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 1640 "__id__": 1652
}, },
{ {
"__id__": 1642 "__id__": 1654
}, },
{ {
"__id__": 1644 "__id__": 1656
} }
], ],
"_prefab": { "_prefab": {
"__id__": 1646 "__id__": 1658
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -39442,7 +39445,9 @@
"_disabledSprite": null, "_disabledSprite": null,
"_duration": 0.1, "_duration": 0.1,
"_zoomScale": 1.2, "_zoomScale": 1.2,
"_target": null, "_target": {
"__id__": 1592
},
"_id": "" "_id": ""
}, },
{ {
@@ -39498,7 +39503,9 @@
"_disabledSprite": null, "_disabledSprite": null,
"_duration": 0.1, "_duration": 0.1,
"_zoomScale": 1.2, "_zoomScale": 1.2,
"_target": null, "_target": {
"__id__": 1592
},
"_id": "" "_id": ""
}, },
{ {
@@ -39520,7 +39527,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "item_times", "_name": "dice",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
@@ -39529,24 +39536,24 @@
"_children": [ "_children": [
{ {
"__id__": 1625 "__id__": 1625
},
{
"__id__": 1631
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 1637 "__id__": 1631
},
{
"__id__": 1633
} }
], ],
"_prefab": { "_prefab": {
"__id__": 1639 "__id__": 1635
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 355,
"y": 0, "y": 375,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -39558,8 +39565,8 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 1, "x": 0.5,
"y": 1, "y": 0.5,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
@@ -39574,7 +39581,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "line", "_name": "lab",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
@@ -39596,7 +39603,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": -29, "y": 0,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -39634,6 +39641,308 @@
"__prefab": { "__prefab": {
"__id__": 1627 "__id__": 1627
}, },
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "491xTcN8FCsIycffy82D2+"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1625
},
"_enabled": true,
"__prefab": {
"__id__": 1629
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 160,
"_fontSize": 160,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": {
"__uuid__": "a199ec88-3efe-4751-8bd3-149a35710fc8",
"__expectedType__": "cc.BitmapFont"
},
"_isSystemFontUsed": false,
"_spacingX": 6,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": false,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_outlineWidth": 2,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_shadowOffset": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
},
"_shadowBlur": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "95UzI/Pb5FPZ058qWZaf2G"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "35flUWLc1GuYxMnj7640nQ",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1624
},
"_enabled": true,
"__prefab": {
"__id__": 1632
},
"_contentSize": {
"__type__": "cc.Size",
"width": 365,
"height": 387
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5fITtNNi1CQI63zT+oAVOf"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1624
},
"_enabled": true,
"__prefab": {
"__id__": 1634
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "3881fbef-b196-44d3-8cd6-114119e29e9b@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "deXdbHGlpLbKrPXV0g/UKC"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "62r/DJ6phEEo28SEPZBP/5",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "item_times",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 1637
},
{
"__id__": 1643
}
],
"_active": false,
"_components": [
{
"__id__": 1649
}
],
"_prefab": {
"__id__": 1651
},
"_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
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "line",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1636
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1638
},
{
"__id__": 1640
}
],
"_prefab": {
"__id__": 1642
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -29,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1637
},
"_enabled": true,
"__prefab": {
"__id__": 1639
},
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 253, "width": 253,
@@ -39656,11 +39965,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 1625 "__id__": 1637
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 1629 "__id__": 1641
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@@ -39714,20 +40023,20 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
"__id__": 1624 "__id__": 1636
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 1632 "__id__": 1644
}, },
{ {
"__id__": 1634 "__id__": 1646
} }
], ],
"_prefab": { "_prefab": {
"__id__": 1636 "__id__": 1648
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -39764,11 +40073,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 1631 "__id__": 1643
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 1633 "__id__": 1645
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -39792,11 +40101,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 1631 "__id__": 1643
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 1635 "__id__": 1647
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@@ -39873,11 +40182,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 1624 "__id__": 1636
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 1638 "__id__": 1650
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -39918,7 +40227,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 1641 "__id__": 1653
}, },
"_hideEvent": 1, "_hideEvent": 1,
"_singleton": true, "_singleton": true,
@@ -40085,6 +40394,9 @@
"dice_all": { "dice_all": {
"__id__": 1592 "__id__": 1592
}, },
"dice_sub": {
"__id__": 1624
},
"btn_ante_sub": { "btn_ante_sub": {
"__id__": 1336 "__id__": 1336
}, },
@@ -40104,7 +40416,7 @@
"__expectedType__": "cc.VideoClip" "__expectedType__": "cc.VideoClip"
}, },
"item_times": { "item_times": {
"__id__": 1624 "__id__": 1636
}, },
"list_times": { "list_times": {
"__id__": 1392 "__id__": 1392
@@ -40128,7 +40440,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 1643 "__id__": 1655
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -40156,7 +40468,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 1645 "__id__": 1657
}, },
"_alignFlags": 45, "_alignFlags": 45,
"_target": null, "_target": null,

View File

@@ -64,6 +64,8 @@ export class PageMain extends BaseView {
@property(Node) ani_dice: Node = null!; @property(Node) ani_dice: Node = null!;
/** 骰子总点数 */ /** 骰子总点数 */
@property(Node) dice_all: Node = null!; @property(Node) dice_all: Node = null!;
/* 骰子倒计时 */
@property(Node) dice_sub: Node = null!;
/** 倍数减按钮 */ /** 倍数减按钮 */
@property(Node) btn_ante_sub: Node = null!; @property(Node) btn_ante_sub: Node = null!;
@property(Node) btn_ante_add: Node = null!; @property(Node) btn_ante_add: Node = null!;
@@ -402,10 +404,12 @@ export class PageMain extends BaseView {
this.scheduleOnce(() => { this.scheduleOnce(() => {
this.dice_all.active = true this.dice_all.active = true
Tools.SetChildText(this.dice_all, "dice/lab", steps.toString()) Tools.SetChildText(this.dice_all, "dice/lab", steps.toString())
Tools.SetChildText(this.dice_sub, "lab", steps.toString())
}, 1.2) }, 1.2)
this.scheduleOnce(() => { this.scheduleOnce(() => {
this.dice_all.active = false this.dice_all.active = false
this.dice_sub.active = true
}, 2.4) }, 2.4)
//亮灯 //亮灯
@@ -468,6 +472,15 @@ export class PageMain extends BaseView {
let totalTime = duration; let totalTime = duration;
let segmentTime = totalTime / path.length; let segmentTime = totalTime / path.length;
let moveNext = (index: number) => { let moveNext = (index: number) => {
let last_dice : string | number = Tools.GetChildComp(this.dice_sub, "lab" , Label).string
last_dice = parseInt(last_dice) - 1
Tools.SetChildText(this.dice_sub, "lab", last_dice.toString())
if (last_dice <= 0) {
this.scheduleOnce(() => {
this.dice_sub.active = false
}, 0.5)
}
let targetPos = path[index]; let targetPos = path[index];
app.manager.sound.playEffect({name : "effect/eff_jump", volume: 0.5}) app.manager.sound.playEffect({name : "effect/eff_jump", volume: 0.5})