[update]新增骰子计数
游标移动时,剩余步数增加倒计时
This commit is contained in:
@@ -64,6 +64,8 @@ export class PageMain extends BaseView {
|
||||
@property(Node) ani_dice: 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_add: Node = null!;
|
||||
@@ -402,10 +404,12 @@ export class PageMain extends BaseView {
|
||||
this.scheduleOnce(() => {
|
||||
this.dice_all.active = true
|
||||
Tools.SetChildText(this.dice_all, "dice/lab", steps.toString())
|
||||
Tools.SetChildText(this.dice_sub, "lab", steps.toString())
|
||||
}, 1.2)
|
||||
|
||||
this.scheduleOnce(() => {
|
||||
this.dice_all.active = false
|
||||
this.dice_sub.active = true
|
||||
}, 2.4)
|
||||
|
||||
//亮灯
|
||||
@@ -468,6 +472,15 @@ export class PageMain extends BaseView {
|
||||
let totalTime = duration;
|
||||
let segmentTime = totalTime / path.length;
|
||||
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];
|
||||
app.manager.sound.playEffect({name : "effect/eff_jump", volume: 0.5})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user