可以消除
This commit is contained in:
parent
a11d5df8e0
commit
174dca549a
@ -268,14 +268,22 @@ export class SlotGame extends Component {
|
||||
|
||||
// 消除完整的逻辑
|
||||
deleteIconNode() {
|
||||
//需要消除的位置
|
||||
let deleteMsg = [];
|
||||
let bottomData = this.spinData.WinPosition.BottomNormal.map(pos => pos + 4);
|
||||
deleteMsg = [...bottomData];
|
||||
//金变百搭的位置
|
||||
let specialIcons = [];
|
||||
|
||||
let specialIcons = [...this.spinData.WinPosition.BottomSilver, ...this.spinData.WinPosition.BottomGold];
|
||||
let aniData = specialIcons.map(pos => pos + 4) || [];
|
||||
let Desc = this.spinData.WinInfo.Desc
|
||||
for (let WinId in Desc) {
|
||||
deleteMsg.push(...Desc[WinId].Middle)
|
||||
if (Desc[WinId].Transform) {
|
||||
specialIcons.push(...Desc[WinId].Transform);
|
||||
}
|
||||
}
|
||||
|
||||
this.rollerManager.handleWinIcons(this.winLayer, deleteMsg, aniData);
|
||||
deleteMsg = deleteMsg.filter(item => specialIcons.indexOf(item) === -1);
|
||||
console.log('deleteMsg', deleteMsg)
|
||||
this.rollerManager.handleWinIcons(this.winLayer, deleteMsg, specialIcons || []);
|
||||
}
|
||||
|
||||
handleScatter(isRollerScrolling: boolean,) {
|
||||
@ -293,20 +301,20 @@ export class SlotGame extends Component {
|
||||
// 先去找到PanChange当中是否有oldPos,如果没有代表当前icon没有动,就去CroSymbols当中找
|
||||
// 初始化changeData数组
|
||||
let changeData = [];
|
||||
let colorChanges = this.spinData.PanChanges.CrossSymbolColorChange
|
||||
// let colorChanges = this.spinData.PanChanges.CrossSymbolColorChange
|
||||
|
||||
|
||||
// 遍历CrossSymbolColorChange获取颜色变化信息
|
||||
for (let key in this.spinData.PanChanges.CrossSymbolColorChange) {
|
||||
let colorChange = this.spinData.PanChanges.CrossSymbolColorChange[key];
|
||||
let newIndex = colorChange.NewColor;
|
||||
for (let key in this.spinData.Change.Details) {
|
||||
// let colorChange = this.spinData.PanChanges.CrossSymbolColorChange[key];
|
||||
let newIndex = 0;
|
||||
let oldStartPos;
|
||||
let frameType;
|
||||
let height;
|
||||
|
||||
// 先在CrossSymbolPosChange中查找位置变化
|
||||
if (this.spinData.PanChanges.CrossSymbolPosChange[key]) {
|
||||
oldStartPos = this.spinData.PanChanges.CrossSymbolPosChange[key].OldPos[0];
|
||||
if (this.spinData.Change.Details[key]) {
|
||||
oldStartPos = this.spinData.Change.Details[key].Pos.Old[0];
|
||||
}
|
||||
// 如果没找到则在CroSymbols中查找
|
||||
else if (this.spinData.CroSymbols[key]) {
|
||||
@ -322,7 +330,7 @@ export class SlotGame extends Component {
|
||||
|
||||
// 添加到changeData数组
|
||||
changeData.push({
|
||||
oldStartPos: oldStartPos + 4,
|
||||
oldStartPos: oldStartPos,
|
||||
newIndex: newIndex,
|
||||
newFrameType: frameType,
|
||||
lheight: height
|
||||
@ -335,9 +343,8 @@ export class SlotGame extends Component {
|
||||
// 消除创建的逻辑
|
||||
createNewIconTop(spinData: any) {
|
||||
this.spinData = spinData;
|
||||
let createDatas = this.spinData.PanChanges.TopNewSymbols;
|
||||
let createDatas2 = this.spinData.PanChanges.BottomNewSymbols;
|
||||
this.rollerManager.createNewIconTop([createDatas, ...createDatas2]);
|
||||
let createDatas = this.spinData.Change.Middle;
|
||||
this.rollerManager.createNewIconTop([...createDatas]);
|
||||
}
|
||||
|
||||
// icon掉落的逻辑
|
||||
|
||||
@ -231,7 +231,7 @@ export class SlotScene extends Component {
|
||||
goNextReconnect(isTwice: boolean) {
|
||||
if (isTwice) return;
|
||||
// 当前盘面有分数,有消除,则播放消除动画
|
||||
if (this.spinData.Score != 0 && this.spinData.WinPosition != null) {
|
||||
if (this.spinData.AllScore != 0 && this.spinData.WinInfo != null) {
|
||||
this.slotGame.deleteIconNode();
|
||||
this.playElemWinAnimation();
|
||||
} else {
|
||||
@ -679,9 +679,9 @@ export class SlotScene extends Component {
|
||||
}
|
||||
|
||||
checkHasEliminate() {
|
||||
this.gameState.isEliminating = this.spinData.WinPosition != null; // 重置消除状态
|
||||
this.gameState.isEliminating = this.spinData.WinInfo != null; // 重置消除状态
|
||||
this.slotGame.setIsEliminating(this.gameState.isEliminating); // 传递给 SlotGame
|
||||
return this.spinData.WinPosition != null;
|
||||
return this.spinData.WinInfo != null;
|
||||
}
|
||||
|
||||
checkHasMoreScatter() {
|
||||
|
||||
@ -248,28 +248,28 @@ export class HistoryDetail extends Component {
|
||||
// 顶上四个横着摆的
|
||||
const hor_symbols = content.getChildByName("hor_symbols")
|
||||
hor_symbols.destroyAllChildren()
|
||||
pan.PanColor.Top.forEach((v, i) => {
|
||||
const item_symbol = instantiate(this.item_symbol)
|
||||
// pan.PanColor.Top.forEach((v, i) => {
|
||||
// const item_symbol = instantiate(this.item_symbol)
|
||||
|
||||
const bg = item_symbol.getChildByName("bg").getComponent(Sprite)
|
||||
const path_bg = `symbol_bg_${v}`
|
||||
bg.spriteFrame = this.symbolsAtlas.getSpriteFrame(path_bg)
|
||||
// const bg = item_symbol.getChildByName("bg").getComponent(Sprite)
|
||||
// const path_bg = `symbol_bg_${v}`
|
||||
// bg.spriteFrame = this.symbolsAtlas.getSpriteFrame(path_bg)
|
||||
|
||||
const symbol = item_symbol.getChildByName("symbol").getComponent(Sprite)
|
||||
const path_symbol = `symbol_${v}_x1`
|
||||
symbol.spriteFrame = this.symbolsAtlas.getSpriteFrame(path_symbol)
|
||||
// const symbol = item_symbol.getChildByName("symbol").getComponent(Sprite)
|
||||
// const path_symbol = `symbol_${v}_x1`
|
||||
// symbol.spriteFrame = this.symbolsAtlas.getSpriteFrame(path_symbol)
|
||||
|
||||
//顶部横着的一排全是铁框
|
||||
const frame = item_symbol.getChildByName("frame").getComponent(Sprite)
|
||||
const path_frame = `frame_0`
|
||||
frame.spriteFrame = this.symbolsAtlas.getSpriteFrame(path_frame)
|
||||
// scatter 和 wild symbol没有金/银/铁框
|
||||
frame.node.active = !this.isScatterOrWild(v)
|
||||
// //顶部横着的一排全是铁框
|
||||
// const frame = item_symbol.getChildByName("frame").getComponent(Sprite)
|
||||
// const path_frame = `frame_0`
|
||||
// frame.spriteFrame = this.symbolsAtlas.getSpriteFrame(path_frame)
|
||||
// // scatter 和 wild symbol没有金/银/铁框
|
||||
// frame.node.active = !this.isScatterOrWild(v)
|
||||
|
||||
item_symbol.position = new Vec3()
|
||||
item_symbol.active = true
|
||||
hor_symbols.addChild(item_symbol)
|
||||
})
|
||||
// item_symbol.position = new Vec3()
|
||||
// item_symbol.active = true
|
||||
// hor_symbols.addChild(item_symbol)
|
||||
// })
|
||||
|
||||
// 下面几列竖着摆的
|
||||
// 5行6列 的网格,固定有6个竖列, 每一列2~5个symbol
|
||||
@ -285,11 +285,11 @@ export class HistoryDetail extends Component {
|
||||
// console.log(`curCrossIdx=${curCrossIdx}`)
|
||||
// console.log(`curSymbolIdx=${curSymbolIdx}`)
|
||||
|
||||
for (let i = 0; i < pan.PanColor.Bottom.length;) {
|
||||
for (let i = 0; i < pan.Symbol.Middle.length;) {
|
||||
// 如果i不等于当前需要处理的连体符号,正常生成一个symbol
|
||||
if (i != curSymbolIdx) {
|
||||
const item_symbol = instantiate(this.item_symbol)
|
||||
let v = pan.PanColor.Bottom[i]
|
||||
let v = pan.Symbol.Middle[i]
|
||||
|
||||
const bg = item_symbol.getChildByName("bg").getComponent(Sprite)
|
||||
const path_bg = `symbol_bg_${v}`
|
||||
@ -325,7 +325,7 @@ export class HistoryDetail extends Component {
|
||||
// console.log(`遇到了连体元素i=${i},curSymbolIdx = ${curSymbolIdx}`)
|
||||
|
||||
const item_symbol = instantiate(this.item_symbol)
|
||||
let v = pan.PanColor.Bottom[i]
|
||||
let v = pan.Symbol.Middle[i]
|
||||
|
||||
let length = pan.CroSymbols[curCrossIdx].PosLast - pan.CroSymbols[curCrossIdx].PosFirst + 1
|
||||
|
||||
|
||||
@ -370,7 +370,6 @@ export class RollerManager extends Component {
|
||||
initRollerWithIcon(data: GameData) {
|
||||
this._spinData = data;
|
||||
|
||||
// let topData = data.PanColor.Top;
|
||||
let bottomData = data.Symbol.Middle;
|
||||
this._CroSymbols = data.CroSymbols;
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import { PREVIEW } from "cc/env"
|
||||
const gameId = "rp_11001";
|
||||
// let apiaddr = "https://rpgames-api.rpfafafahkdev.com";
|
||||
let apiaddr = "";
|
||||
let token = "eyJQIjoxMDIyNDksIkUiOjE3NjM1Nzk2NTIsIlMiOjk5OSwiRCI6InJwXzExMDAxIn0.7Z8z7XOUvp3XU795wRfy4CrgXZBD38w1mAYErFufAWw";
|
||||
let token = "eyJQIjoxMDA5NDksIkUiOjE3NjM2NzAzMDAsIlMiOjEwMDMsIkQiOiJycF8xMTAwMSJ9.3flLZnTD1xphdF3e2rjCdDlc6BXLpAXOP7_I2kusTVY";
|
||||
|
||||
|
||||
let language = "en"
|
||||
|
||||
@ -54,7 +54,7 @@ export class LoadingUI extends Component {
|
||||
private lightNode: Node = null;
|
||||
|
||||
protected async onLoad() {
|
||||
initErrorManager();
|
||||
// initErrorManager();
|
||||
// 初始显示状态
|
||||
this.initUI();
|
||||
this.LoadingUINode.active = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user