普通模式优化赢分显示
This commit is contained in:
parent
3deac8c38a
commit
275562c9b8
File diff suppressed because it is too large
Load Diff
@ -30,6 +30,8 @@ export class SlotGame extends Component {
|
|||||||
private readyHand: Node = null;
|
private readyHand: Node = null;
|
||||||
private scatterLayer: Node = null;
|
private scatterLayer: Node = null;
|
||||||
|
|
||||||
|
private allScore: number = 0
|
||||||
|
|
||||||
// 赢分信息相关
|
// 赢分信息相关
|
||||||
private winType: Node = null;
|
private winType: Node = null;
|
||||||
private winTypeAni: Animation = null;
|
private winTypeAni: Animation = null;
|
||||||
@ -40,6 +42,7 @@ export class SlotGame extends Component {
|
|||||||
// private normalWinSprite: Node = null;
|
// private normalWinSprite: Node = null;
|
||||||
private normalTotalWinSprite: Node = null;
|
private normalTotalWinSprite: Node = null;
|
||||||
private normalWinLabel: Label = null;
|
private normalWinLabel: Label = null;
|
||||||
|
private normalWinLabel_top: Label = null;
|
||||||
|
|
||||||
private totalWin: Node = null;
|
private totalWin: Node = null;
|
||||||
private totalWinLayout: Layout = null;
|
private totalWinLayout: Layout = null;
|
||||||
@ -102,6 +105,7 @@ export class SlotGame extends Component {
|
|||||||
// this.normalWinSprite = this.normalWinLayout.node.getChildByName('winSprite');
|
// this.normalWinSprite = this.normalWinLayout.node.getChildByName('winSprite');
|
||||||
this.normalTotalWinSprite = this.normalWinLayout.node.getChildByName('totalWinSprite');
|
this.normalTotalWinSprite = this.normalWinLayout.node.getChildByName('totalWinSprite');
|
||||||
this.normalWinLabel = this.normalWinLayout.node.getChildByName('winScore').getComponent(Label);
|
this.normalWinLabel = this.normalWinLayout.node.getChildByName('winScore').getComponent(Label);
|
||||||
|
this.normalWinLabel_top = frameNode.getChildByName('winScore_top').getComponent(Label);
|
||||||
|
|
||||||
this.totalWinLayout = this.totalWin.getChildByName('layout').getComponent(Layout);
|
this.totalWinLayout = this.totalWin.getChildByName('layout').getComponent(Layout);
|
||||||
this.totalWinLabel = this.totalWinLayout.node.getChildByName('winScore').getComponent(Label);
|
this.totalWinLabel = this.totalWinLayout.node.getChildByName('winScore').getComponent(Label);
|
||||||
@ -228,6 +232,7 @@ export class SlotGame extends Component {
|
|||||||
this.showWinScore(false, false, false, false, false);
|
this.showWinScore(false, false, false, false, false);
|
||||||
this.rollerManager.resetInfo();
|
this.rollerManager.resetInfo();
|
||||||
this.rollerManager.startScroll();
|
this.rollerManager.startScroll();
|
||||||
|
this.allScore = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -403,7 +408,7 @@ export class SlotGame extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
showWinScore(bol: boolean, isFirstWin: boolean, isBigWin: boolean, isReconnect: boolean, isNormalTotalWin: boolean, score?: number) {
|
showWinScore(bol: boolean, isFirstWin: boolean, isBigWin: boolean, isReconnect: boolean, isNormalTotalWin: boolean, needTopScore?: boolean, score?: number) {
|
||||||
// 隐藏
|
// 隐藏
|
||||||
if (!bol) {
|
if (!bol) {
|
||||||
this.normalWin.active = false;
|
this.normalWin.active = false;
|
||||||
@ -413,10 +418,6 @@ export class SlotGame extends Component {
|
|||||||
this.winTypeAni.resume();
|
this.winTypeAni.resume();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.winTypeAni.node.getChildByName('AniNode').active = true;
|
|
||||||
// 设置活动显示窗口
|
|
||||||
this.normalWin.active = !isBigWin;
|
|
||||||
this.totalWin.active = isBigWin;
|
|
||||||
|
|
||||||
// 更新对应标签和布局
|
// 更新对应标签和布局
|
||||||
if (isBigWin) {
|
if (isBigWin) {
|
||||||
@ -425,6 +426,7 @@ export class SlotGame extends Component {
|
|||||||
}
|
}
|
||||||
this.totalWinLabel.string = gold2cash(score);
|
this.totalWinLabel.string = gold2cash(score);
|
||||||
this.totalWinLayout.updateLayout();
|
this.totalWinLayout.updateLayout();
|
||||||
|
this.playMarqueeAnimation(isFirstWin, isBigWin)
|
||||||
} else {
|
} else {
|
||||||
if (isNormalTotalWin) {
|
if (isNormalTotalWin) {
|
||||||
if (!isReconnect) {
|
if (!isReconnect) {
|
||||||
@ -439,10 +441,39 @@ export class SlotGame extends Component {
|
|||||||
// this.normalWinSprite.active = false;
|
// this.normalWinSprite.active = false;
|
||||||
this.normalTotalWinSprite.active = false;
|
this.normalTotalWinSprite.active = false;
|
||||||
}
|
}
|
||||||
|
if (needTopScore) {
|
||||||
|
console.log('TEST', needTopScore)
|
||||||
|
this.allScore += score
|
||||||
|
this.normalWinLabel_top.string = gold2cash(score);
|
||||||
|
tween(this.normalWinLabel_top.node)
|
||||||
|
.to(0.2, { scale: new Vec3(1, 1, 1) })
|
||||||
|
.to(0.05, { position: new Vec3(0, 360, 0) })
|
||||||
|
.to(0.25, { position: new Vec3(0, 30, 0) })
|
||||||
|
.call(() => {
|
||||||
|
this.normalWinLabel_top.node.setScale(0, 0, 0)
|
||||||
|
this.normalWinLabel_top.node.setPosition(0, 350, 0)
|
||||||
|
this.normalWinLabel.string = gold2cash(this.allScore);
|
||||||
|
this.normalWinLayout.updateLayout();
|
||||||
|
this.playMarqueeAnimation(isFirstWin, isBigWin)
|
||||||
|
|
||||||
|
})
|
||||||
|
.start()
|
||||||
|
} else {
|
||||||
this.normalWinLabel.string = gold2cash(score);
|
this.normalWinLabel.string = gold2cash(score);
|
||||||
this.normalWinLayout.updateLayout();
|
this.normalWinLayout.updateLayout();
|
||||||
|
this.playMarqueeAnimation(isFirstWin, isBigWin)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
playMarqueeAnimation(isFirstWin, isBigWin) {
|
||||||
|
this.winTypeAni.node.getChildByName('AniNode').active = true;
|
||||||
|
// 设置活动显示窗口
|
||||||
|
this.normalWin.active = !isBigWin;
|
||||||
|
this.totalWin.active = isBigWin;
|
||||||
// 播放动画效果
|
// 播放动画效果
|
||||||
if (isFirstWin) {
|
if (isFirstWin) {
|
||||||
this.winTypeAni.play('Marquee_in_animation');
|
this.winTypeAni.play('Marquee_in_animation');
|
||||||
@ -457,7 +488,6 @@ export class SlotGame extends Component {
|
|||||||
this.winTypeAni.play('Marquee_loop_animation');
|
this.winTypeAni.play('Marquee_loop_animation');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkWinType(score: number) {
|
checkWinType(score: number) {
|
||||||
|
|||||||
@ -614,7 +614,7 @@ export class SlotScene extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
playElemWinAnimation(isFirstWin: boolean = false) {
|
playElemWinAnimation(isFirstWin: boolean = false) {
|
||||||
this.slotGame.showWinScore(true, isFirstWin, false, false, false, this.spinData.AllScore);
|
this.slotGame.showWinScore(true, isFirstWin, false, false, false, true, this.spinData.Score);
|
||||||
this.slotBar.setWin(this.spinData.AllScore);
|
this.slotBar.setWin(this.spinData.AllScore);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -706,14 +706,14 @@ export class SlotScene extends Component {
|
|||||||
if (!isReconnect) {
|
if (!isReconnect) {
|
||||||
this.TotalWin.show(this.spinData.AllScore, () => {
|
this.TotalWin.show(this.spinData.AllScore, () => {
|
||||||
this.slotBar.setBalance(this.spinData.Balance);
|
this.slotBar.setBalance(this.spinData.Balance);
|
||||||
this.slotGame.showWinScore(true, false, true, isReconnect, false, this.spinData.AllScore);
|
this.slotGame.showWinScore(true, false, true, isReconnect, false, false, this.spinData.AllScore);
|
||||||
this.slotBar.setWin(this.spinData.AllScore);
|
this.slotBar.setWin(this.spinData.AllScore);
|
||||||
this.slotGame.changeBg(false);
|
this.slotGame.changeBg(false);
|
||||||
this.checkAutoSpin(true, isReconnect);
|
this.checkAutoSpin(true, isReconnect);
|
||||||
AudioManager.instance.playBGM('Normal_Mode_BGM');
|
AudioManager.instance.playBGM('Normal_Mode_BGM');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.slotGame.showWinScore(true, false, true, isReconnect, false, this.spinData.AllScore);
|
this.slotGame.showWinScore(true, false, true, isReconnect, false, false, this.spinData.AllScore);
|
||||||
this.slotBar.setWin(this.spinData.AllScore);
|
this.slotBar.setWin(this.spinData.AllScore);
|
||||||
this.slotBar.setBalance(this.spinData.Balance);
|
this.slotBar.setBalance(this.spinData.Balance);
|
||||||
this.slotGame.changeBg(false);
|
this.slotGame.changeBg(false);
|
||||||
@ -757,13 +757,13 @@ export class SlotScene extends Component {
|
|||||||
let score = isFreeSpin ? this.spinData.RoundInfo.AllScore : this.spinData.AllScore;
|
let score = isFreeSpin ? this.spinData.RoundInfo.AllScore : this.spinData.AllScore;
|
||||||
if (winType >= WIN_TYPE.BIG_WIN) {
|
if (winType >= WIN_TYPE.BIG_WIN) {
|
||||||
this.BigWinUI.setCloseCallBack(() => {
|
this.BigWinUI.setCloseCallBack(() => {
|
||||||
this.slotGame.showWinScore(true, false, true, false, false, score);
|
this.slotGame.showWinScore(true, false, true, false, false, false, score);
|
||||||
this.slotBar.setWin(this.spinData.AllScore);
|
this.slotBar.setWin(this.spinData.AllScore);
|
||||||
callback?.();
|
callback?.();
|
||||||
});
|
});
|
||||||
this.BigWinUI.show(score, winType, this.slotBar.getBet());
|
this.BigWinUI.show(score, winType, this.slotBar.getBet());
|
||||||
} else {
|
} else {
|
||||||
this.slotGame.showWinScore(true, false, false, false, true, score);
|
this.slotGame.showWinScore(true, false, false, false, true, false, score);
|
||||||
this.slotBar.setWin(this.spinData.AllScore);
|
this.slotBar.setWin(this.spinData.AllScore);
|
||||||
callback?.();
|
callback?.();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { PREVIEW } from "cc/env"
|
|||||||
const gameId = "rp_10012";
|
const gameId = "rp_10012";
|
||||||
// let apiaddr = "https://rpgames-api.rpfafafahkdev.com";
|
// let apiaddr = "https://rpgames-api.rpfafafahkdev.com";
|
||||||
let apiaddr = "";
|
let apiaddr = "";
|
||||||
let token = "eyJQIjoxMDA5NDksIkUiOjE3NTgyMDI3NzMsIlMiOjEwMDUsIkQiOiJycF8xMDAxMiJ9.Ogx06nfgXm7WzwVay0zrI6tE_H8A9EyxRdriKDAPUIs";
|
let token = "eyJQIjoxMDA5NDksIkUiOjE3NTgyODg4NTUsIlMiOjEwMDEsIkQiOiJycF8xMDAxMiJ9.ACXfz_xRscCMbBWPbQhK825fG0UpsWMbMXviuKXgscc";
|
||||||
let language = "en"
|
let language = "en"
|
||||||
let currency = "THB"
|
let currency = "THB"
|
||||||
let supportUrl = ""
|
let supportUrl = ""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user