普通模式优化赢分显示

This commit is contained in:
TJH 2025-09-19 11:34:23 +08:00
parent 3deac8c38a
commit 275562c9b8
4 changed files with 2229 additions and 2010 deletions

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,8 @@ export class SlotGame extends Component {
private readyHand: Node = null;
private scatterLayer: Node = null;
private allScore: number = 0
// 赢分信息相关
private winType: Node = null;
private winTypeAni: Animation = null;
@ -40,6 +42,7 @@ export class SlotGame extends Component {
// private normalWinSprite: Node = null;
private normalTotalWinSprite: Node = null;
private normalWinLabel: Label = null;
private normalWinLabel_top: Label = null;
private totalWin: Node = null;
private totalWinLayout: Layout = null;
@ -102,6 +105,7 @@ export class SlotGame extends Component {
// this.normalWinSprite = this.normalWinLayout.node.getChildByName('winSprite');
this.normalTotalWinSprite = this.normalWinLayout.node.getChildByName('totalWinSprite');
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.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.rollerManager.resetInfo();
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) {
this.normalWin.active = false;
@ -413,10 +418,6 @@ export class SlotGame extends Component {
this.winTypeAni.resume();
return;
}
this.winTypeAni.node.getChildByName('AniNode').active = true;
// 设置活动显示窗口
this.normalWin.active = !isBigWin;
this.totalWin.active = isBigWin;
// 更新对应标签和布局
if (isBigWin) {
@ -425,6 +426,7 @@ export class SlotGame extends Component {
}
this.totalWinLabel.string = gold2cash(score);
this.totalWinLayout.updateLayout();
this.playMarqueeAnimation(isFirstWin, isBigWin)
} else {
if (isNormalTotalWin) {
if (!isReconnect) {
@ -439,10 +441,39 @@ export class SlotGame extends Component {
// this.normalWinSprite.active = false;
this.normalTotalWinSprite.active = false;
}
this.normalWinLabel.string = gold2cash(score);
this.normalWinLayout.updateLayout();
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.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) {
this.winTypeAni.play('Marquee_in_animation');
@ -457,7 +488,6 @@ export class SlotGame extends Component {
this.winTypeAni.play('Marquee_loop_animation');
});
}
}
checkWinType(score: number) {

View File

@ -614,7 +614,7 @@ export class SlotScene extends Component {
}
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);
}
@ -706,14 +706,14 @@ export class SlotScene extends Component {
if (!isReconnect) {
this.TotalWin.show(this.spinData.AllScore, () => {
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.slotGame.changeBg(false);
this.checkAutoSpin(true, isReconnect);
AudioManager.instance.playBGM('Normal_Mode_BGM');
});
} 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.setBalance(this.spinData.Balance);
this.slotGame.changeBg(false);
@ -757,13 +757,13 @@ export class SlotScene extends Component {
let score = isFreeSpin ? this.spinData.RoundInfo.AllScore : this.spinData.AllScore;
if (winType >= WIN_TYPE.BIG_WIN) {
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);
callback?.();
});
this.BigWinUI.show(score, winType, this.slotBar.getBet());
} 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);
callback?.();
}

View File

@ -7,7 +7,7 @@ import { PREVIEW } from "cc/env"
const gameId = "rp_10012";
// let apiaddr = "https://rpgames-api.rpfafafahkdev.com";
let apiaddr = "";
let token = "eyJQIjoxMDA5NDksIkUiOjE3NTgyMDI3NzMsIlMiOjEwMDUsIkQiOiJycF8xMDAxMiJ9.Ogx06nfgXm7WzwVay0zrI6tE_H8A9EyxRdriKDAPUIs";
let token = "eyJQIjoxMDA5NDksIkUiOjE3NTgyODg4NTUsIlMiOjEwMDEsIkQiOiJycF8xMDAxMiJ9.ACXfz_xRscCMbBWPbQhK825fG0UpsWMbMXviuKXgscc";
let language = "en"
let currency = "THB"
let supportUrl = ""