更新冻结门功能

This commit is contained in:
YZ\249929363 2025-07-23 18:50:23 +08:00
parent 0c1fa52444
commit e264a243ca
13 changed files with 2576 additions and 2818 deletions

View File

@ -169,7 +169,12 @@ export default class GameManager extends cc.Component {
startGame() { startGame() {
console.log("进入场景之前_____________", cc.fx.GameConfig.GM_INFO.first); console.log("进入场景之前_____________", cc.fx.GameConfig.GM_INFO.first);
console.log(cc.fx.GameConfig.GM_INFO.level); console.log(cc.fx.GameConfig.GM_INFO.level);
// 加载 music bundle cc.assetManager.loadBundle('shop', (err, bundle) => {
if (err) {
console.error('加载 shop 失败:', err);
} else {
console.log('shop加载成功');
// 加载成功后进入 HomeScene
cc.assetManager.loadBundle('music', (err, bundle) => { cc.assetManager.loadBundle('music', (err, bundle) => {
if (err) { if (err) {
console.error('加载 music bundle 失败:', err); console.error('加载 music bundle 失败:', err);
@ -177,18 +182,14 @@ export default class GameManager extends cc.Component {
cc.director.loadScene("HomeScene"); cc.director.loadScene("HomeScene");
} else { } else {
console.log('music bundle 加载成功'); console.log('music bundle 加载成功');
cc.assetManager.loadBundle('shop', (err, bundle) => {
if (err) {
console.error('加载 shop 失败:', err);
} else {
console.log('shop加载成功');
// 加载成功后进入 HomeScene
cc.director.loadScene("HomeScene");
} }
cc.director.loadScene("HomeScene");
}); });
} }
}); });
// 加载 music bundle
} }
returnHome() { returnHome() {
@ -431,7 +432,7 @@ export default class GameManager extends cc.Component {
"magicAmount": cc.fx.GameConfig.GM_INFO.magicAmoun, "magicAmount": cc.fx.GameConfig.GM_INFO.magicAmoun,
"timestamp": timestamp "timestamp": timestamp
} }
console.log("_______________上传道具信息:", propInfoNew); console.log("_______________1111上传道具信息:", propInfoNew);
cc.fx.StorageMessage.setStorage("prop", propInfoNew); cc.fx.StorageMessage.setStorage("prop", propInfoNew);
} }
else { else {
@ -491,7 +492,7 @@ export default class GameManager extends cc.Component {
} }
//旧用户,无本地缓存读取配置 //旧用户,无本地缓存读取配置
oldReadData(retryCount: number) { oldReadData(retryCount: number) {
console.log("读取旧信息"); console.log("________读取旧信息");
const MAX_RETRIES = 15; const MAX_RETRIES = 15;
const timestamp = Date.now(); const timestamp = Date.now();
// 读取用户数据 // 读取用户数据
@ -502,7 +503,7 @@ export default class GameManager extends cc.Component {
action: 'read' action: 'read'
}, },
success: res => { success: res => {
console.log('读取用户数据成功', res.result) console.log('11111111读取用户数据成功', res.result)
if (res.result.code == 404 && res.result.message == "未找到用户数据") { if (res.result.code == 404 && res.result.message == "未找到用户数据") {
if (res.result.openid) { if (res.result.openid) {
console.log("用户从未进入过第一次设置openid:"); console.log("用户从未进入过第一次设置openid:");
@ -521,11 +522,15 @@ export default class GameManager extends cc.Component {
console.log("33333333333"); console.log("33333333333");
cc.fx.StorageMessage.setStorage("coin", coinInfo); cc.fx.StorageMessage.setStorage("coin", coinInfo);
let propInfo = { let propInfo = {
"freezeAmount": 0, "freezeAmount": 3,
"hammerAmount": 0, "hammerAmount": 3,
"magicAmount": 0, "magicAmount": 3,
"timestamp": timestamp, "timestamp": timestamp,
} }
console.log("最新上传道具信息——————————:", propInfo);
cc.fx.GameConfig.GM_INFO.freezeAmount = 3;
cc.fx.GameConfig.GM_INFO.hammerAmount = 3;
cc.fx.GameConfig.GM_INFO.magicAmount = 3;
cc.fx.StorageMessage.setStorage("prop", propInfo); cc.fx.StorageMessage.setStorage("prop", propInfo);

View File

@ -700,9 +700,7 @@ export default class MapConroler extends cc.Component {
this.createTurn(dir, block, block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY); this.createTurn(dir, block, block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY);
} }
} }
} }
} }
createWall(direction, node) { createWall(direction, node) {
@ -1208,18 +1206,21 @@ export default class MapConroler extends cc.Component {
} }
if (wallArray[i].getComponent("Wall").special == 2 && wallArray[i].getComponent("Wall").open == false) { if (wallArray[i].getComponent("Wall").special == 2 && wallArray[i].getComponent("Wall").open == false) {
jg = false; jg = false;
break; return jg;
}
if (wallArray[i].getComponent("Wall").special == 3) {
jg = false;
return jg;
} }
//console.log(wallArray[i].getChildByName("wall").getComponent("Wall").color,node.getComponent("Block").color) //console.log(wallArray[i].getChildByName("wall").getComponent("Wall").color,node.getComponent("Block").color)
if (wallArray[i].getComponent("Wall").color != node.getComponent("Block").color) { if (wallArray[i].getComponent("Wall").color != node.getComponent("Block").color) {
jg = false; jg = false;
break; return jg;
} }
if (node.getComponent("Block").type == 5) { if (node.getComponent("Block").type == 5) {
if (wallArray[i].getComponent("Wall").special != 1) { if (wallArray[i].getComponent("Wall").special != 1) {
jg = false; jg = false;
break; return jg;
} }
} }
} }
@ -2545,56 +2546,56 @@ export default class MapConroler extends cc.Component {
// return; // return;
// } // }
} }
// else if (nomalArray.length == 1) { else if (nomalArray.length == 1) {
// nomalArray[0].getComponent("Block").eliminate(); nomalArray[0].getComponent("Block").eliminate();
// let time = 0; let time = 0;
// if (nomalArray[0].getComponent("Block").type == 1 || nomalArray[0].getComponent("Block").type == 9) { if (nomalArray[0].getComponent("Block").type == 1 || nomalArray[0].getComponent("Block").type == 9) {
// time = 200; time = 200;
// } }
// setTimeout(() => { setTimeout(() => {
// if (this.freezeArray.length == 0 && this.loackArray.length == 0) { if (this.freezeArray.length == 0 && this.loackArray.length == 0) {
// // console.log("只剩下一个块道具使用完毕"); // console.log("只剩下一个块道具使用完毕");
// } }
// else { else {
// if (this.loackArray.length != 0) { if (this.loackArray.length != 0) {
// // console.log("消除一个普通块后,消除一个带锁块"); // console.log("消除一个普通块后,消除一个带锁块");
// this.loackArray[0].getComponent("Block").eliminate(); this.loackArray[0].getComponent("Block").eliminate();
// return; return;
// } }
// else if (this.freezeArray.length != 0) { else if (this.freezeArray.length != 0) {
// // console.log("消除一个普通块后,消除一个冻结块"); // console.log("消除一个普通块后,消除一个冻结块");
// this.freezeArray[0].getComponent("Block").eliminate(); this.freezeArray[0].getComponent("Block").eliminate();
// return; return;
// } }
// } }
// }, 200 + time); }, 200 + time);
// } }
// else { else {
// let count = 2; let count = 2;
// if (this.loackArray.length != 0) { if (this.loackArray.length != 0) {
// for (let i = 0; i < this.loackArray.length; i++) { for (let i = 0; i < this.loackArray.length; i++) {
// // console.log("没有普通快,魔法消除一个带锁块"); // console.log("没有普通快,魔法消除一个带锁块");
// this.loackArray[i].getComponent("Block").eliminate(); this.loackArray[i].getComponent("Block").eliminate();
// count -= 1; count -= 1;
// if (count == 0) { if (count == 0) {
// break; break;
// } }
// } }
// } }
// setTimeout(() => { setTimeout(() => {
// if (count != 0) { if (count != 0) {
// for (let i = 0; i < this.freezeArray.length; i++) { for (let i = 0; i < this.freezeArray.length; i++) {
// // console.log("没有普通快,魔法消除一个冻结块"); // console.log("没有普通快,魔法消除一个冻结块");
// // this.freezeArray[i].getComponent("Block").eliminate(); // this.freezeArray[i].getComponent("Block").eliminate();
// count -= 1; count -= 1;
// if (count == 0) { if (count == 0) {
// break; break;
// } }
// } }
// } }
// }, 100); }, 100);
// } }
} }
} }
} }

View File

@ -36,7 +36,7 @@ export default class Reward extends cc.Component {
} }
else { else {
// 游戏整体加速 // 游戏整体加速
this.speedUpGame(); // this.speedUpGame();
} }
} }

View File

@ -6,10 +6,11 @@
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import MapConroler from "./Map"; import MapConroler from "./Map";
import NumberToImage from "./NumberToImage";
const {ccclass, property} = cc._decorator; const { ccclass, property } = cc._decorator;
export enum WallSpecial{ export enum WallSpecial {
/*普通门*/ /*普通门*/
"普通门" = 0, "普通门" = 0,
/*星星门*/ /*星星门*/
@ -20,7 +21,7 @@ export enum WallSpecial{
"冻结门" = 3, "冻结门" = 3,
} }
export enum WallType{ export enum WallType {
/*普通地块 */ /*普通地块 */
"门横向下" = 0, "门横向下" = 0,
@ -40,7 +41,7 @@ export enum WallType{
"墙竖向左" = 7, "墙竖向左" = 7,
} }
export enum WallColor{ export enum WallColor {
/*普通地块 */ /*普通地块 */
"紫色" = 0, "紫色" = 0,
/*湿地 */ /*湿地 */
@ -93,6 +94,9 @@ export default class Wall extends cc.Component {
@property(cc.SpriteAtlas) @property(cc.SpriteAtlas)
down_SpriteFrames: cc.SpriteAtlas = null; down_SpriteFrames: cc.SpriteAtlas = null;
@property(cc.Prefab)
freezeSpine: cc.Prefab = null;
posX: number; posX: number;
posY: number; posY: number;
@ -100,14 +104,15 @@ export default class Wall extends cc.Component {
wall_Info: any; wall_Info: any;
openNode: cc.Node; openNode: cc.Node;
freezeNode: cc.Node; freezeNode: cc.Node;
open:boolean; open: boolean;
freezeNumber: number;
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
// onLoad () {} // onLoad () {}
start () { start() {
// console.log(this.type); // console.log(this.type);
} }
@ -115,28 +120,28 @@ export default class Wall extends cc.Component {
return JSON.parse(JSON.stringify(obj)); return JSON.parse(JSON.stringify(obj));
} }
init(wall_Info, posX: number, posY: number, direction: any){ init(wall_Info, posX: number, posY: number, direction: any) {
this.wall_Info = this.jsonDeepClone(wall_Info); this.wall_Info = this.jsonDeepClone(wall_Info);
// this.open = true; // this.open = true;
if(wall_Info == null){ if (wall_Info == null) {
this.posX = posX; this.posX = posX;
this.posY = posY; this.posY = posY;
if(direction)this.direction = direction; if (direction) this.direction = direction;
// console.log("门方向赋值",direction); // console.log("门方向赋值",direction);
if(direction == "up" ){ if (direction == "up") {
this.node.parent.zIndex = 100 + this.posX - this.posY*3; this.node.parent.zIndex = 100 + this.posX - this.posY * 3;
} }
else if( direction == "down" || direction == "right" || else if (direction == "down" || direction == "right" ||
direction == "rightdown" || direction == "downright" direction == "rightdown" || direction == "downright"
|| direction == "rightup" || direction == "upright"){ || direction == "rightup" || direction == "upright") {
this.node.parent.zIndex = 30 + this.posX - this.posY*3; this.node.parent.zIndex = 30 + this.posX - this.posY * 3;
} }
else if( direction == "left"|| direction == "leftdown" || direction == "downleft"){ else if (direction == "left" || direction == "leftdown" || direction == "downleft") {
this.node.parent.zIndex = 70 + this.posX - this.posY*3; this.node.parent.zIndex = 70 + this.posX - this.posY * 3;
} }
else this.node.parent.zIndex = 70 + this.posX - this.posY*3; else this.node.parent.zIndex = 70 + this.posX - this.posY * 3;
MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id = "Wall"; MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id = "Wall";
//console.log(this.posX,this.posY,MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id); //console.log(this.posX,this.posY,MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id);
@ -144,15 +149,15 @@ export default class Wall extends cc.Component {
//this.node.getChildByName("num").getComponent(cc.Label).string = direction; //this.node.getChildByName("num").getComponent(cc.Label).string = direction;
//this.node.getChildByName("num").getComponent(cc.Label).string = ":" + this.node.parent.zIndex; //this.node.getChildByName("num").getComponent(cc.Label).string = ":" + this.node.parent.zIndex;
} }
if(wall_Info != null){ if (wall_Info != null) {
this.color = wall_Info.color; this.color = wall_Info.color;
this.special = wall_Info.special; this.special = wall_Info.special;
this.initType(); this.initType();
if(wall_Info.length > 0){ if (wall_Info.length > 0) {
this.initColor(wall_Info.length); this.initColor(wall_Info.length);
} }
else this.node.removeComponent("cc.Sprite"); else this.node.removeComponent("cc.Sprite");
if(this.posX != null){ if (this.posX != null) {
MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id = "Wall"; MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id = "Wall";
//console.log(this.posX,this.posY,MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id); //console.log(this.posX,this.posY,MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id);
} }
@ -164,21 +169,21 @@ export default class Wall extends cc.Component {
} }
//创建门的颜色 //创建门的颜色
initColor(length: number){ initColor(length: number) {
let direction = this.node.parent.name; let direction = this.node.parent.name;
let double = 0; let double = 0;
if(direction == "left" || direction == "right"){ if (direction == "left" || direction == "right") {
double = 3; double = 3;
} }
// debugger; // debugger;
if(this.wall_SpriteFrames){ if (this.wall_SpriteFrames) {
let name = this.color+"color" + (length+double); let name = this.color + "color" + (length + double);
var spriteFrame = this.wall_SpriteFrames._spriteFrames[name]; var spriteFrame = this.wall_SpriteFrames._spriteFrames[name];
this.node.getComponent(cc.Sprite).spriteFrame = spriteFrame; this.node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
} }
if(this.down_SpriteFrames){ if (this.down_SpriteFrames) {
let name2 = this.color + "down" + (length+double); let name2 = this.color + "down" + (length + double);
var downFrame = this.down_SpriteFrames._spriteFrames[name2]; var downFrame = this.down_SpriteFrames._spriteFrames[name2];
this.node.parent.getChildByName("down").getComponent(cc.Sprite).spriteFrame = downFrame; this.node.parent.getChildByName("down").getComponent(cc.Sprite).spriteFrame = downFrame;
} }
@ -187,33 +192,33 @@ export default class Wall extends cc.Component {
} }
//创建特殊类型门 //创建特殊类型门
initType(){ initType() {
switch(this.special){ switch (this.special) {
case WallSpecial.: case WallSpecial.:
let star = cc.instantiate(MapConroler._instance.Block_Prop[this.special]); let star = cc.instantiate(MapConroler._instance.Block_Prop[this.special]);
star.parent = this.node.parent; star.parent = this.node.parent;
// console.log("门的方向",this.direction,"长度",this.wall_Info.length); // console.log("门的方向",this.direction,"长度",this.wall_Info.length);
// star.scaleX = star.scaleY = 0.5; // star.scaleX = star.scaleY = 0.5;
if(this.wall_Info.length > 0){ if (this.wall_Info.length > 0) {
if(this.direction == "right" || this.direction == "left"){ if (this.direction == "right" || this.direction == "left") {
star.children[this.wall_Info.length + 2].active = true; star.children[this.wall_Info.length + 2].active = true;
} }
else if(this.direction == "up" || this.direction == "down"){ else if (this.direction == "up" || this.direction == "down") {
star.children[this.wall_Info.length - 1].active = true; star.children[this.wall_Info.length - 1].active = true;
} }
} }
star.setPosition(this.node.width/2+this.node.x,this.node.height/2+this.node.y); star.setPosition(this.node.width / 2 + this.node.x, this.node.height / 2 + this.node.y);
break; break;
case WallSpecial.: case WallSpecial.:
let name = "open" + this.wall_Info.length; let name = "open" + this.wall_Info.length;
this.openNode = this.node.parent.getChildByName("open").getChildByName(name); this.openNode = this.node.parent.getChildByName("open").getChildByName(name);
this.openNode.active = true; this.openNode.active = true;
if(this.wall_Info.lock == false){ if (this.wall_Info.lock == false) {
this.open = true; this.open = true;
this.openNode.children[0].scaleX *= 0.01; this.openNode.children[0].scaleX *= 0.01;
this.openNode.children[1].scaleX *= 0.01; this.openNode.children[1].scaleX *= 0.01;
} }
else{ else {
this.open = false; this.open = false;
} }
break; break;
@ -221,23 +226,25 @@ export default class Wall extends cc.Component {
let freeze = "freeze" + this.wall_Info.length; let freeze = "freeze" + this.wall_Info.length;
this.freezeNode = this.node.parent.getChildByName("freeze").getChildByName(freeze); this.freezeNode = this.node.parent.getChildByName("freeze").getChildByName(freeze);
this.freezeNode.active = true; this.freezeNode.active = true;
if(this.wall_Info.freeze){
this.freezeNode.getChildByName("num").getComponent(cc.Label).string = this.wall_Info.freeze+""; if (this.wall_Info.freeze) {
this.freezeNumber = this.wall_Info.freeze;
NumberToImage.numberToImageNodes(this.freezeNumber, 20, 8, "lock_", this.freezeNode.getChildByName("num"), false);
} }
break; break;
} }
} }
//播放星星门通过 //播放星星门通过
playStarDoor(){ playStarDoor() {
if(this.node.parent.getChildByName("star")){ if (this.node.parent.getChildByName("star")) {
let star = this.node.parent.getChildByName("star"); let star = this.node.parent.getChildByName("star");
for(let i=0; i<star.children.length; i++){ for (let i = 0; i < star.children.length; i++) {
if(star.children[i].active == true){ if (star.children[i].active == true) {
let starChild = star.children[i]; let starChild = star.children[i];
for(let j=0; j<starChild.children.length; j++){ for (let j = 0; j < starChild.children.length; j++) {
starChild.children[j].active = true starChild.children[j].active = true
starChild.children[j].getComponent(sp.Skeleton).setAnimation(1,"taopao1",false); starChild.children[j].getComponent(sp.Skeleton).setAnimation(1, "taopao1", false);
} }
} }
} }
@ -246,67 +253,85 @@ export default class Wall extends cc.Component {
//改变开关门状态 //改变开关门状态
changeLock(){ changeLock() {
this.open = !this.open; this.open = !this.open;
console.log("开关门状态改变",this.open); console.log("开关门状态改变", this.open);
if(!this.openNode.active){ if (!this.openNode.active) {
this.openNode.active = true; this.openNode.active = true;
} }
let fill = this.openNode.children[0].scaleX==1 ? 0.01:1; let fill = this.openNode.children[0].scaleX == 1 ? 0.01 : 1;
if(this.openNode.children[0].scaleX < 0) fill = -fill; if (this.openNode.children[0].scaleX < 0) fill = -fill;
// console.log("目标",fill); // console.log("目标",fill);
cc.tween(this.openNode.children[0]) cc.tween(this.openNode.children[0])
.to(0.3, {scaleX: this.openNode.children[0].scaleX < 0?-fill:fill}) .to(0.3, { scaleX: this.openNode.children[0].scaleX < 0 ? -fill : fill })
.call(()=>{ .call(() => {
// console.log("左边完成"); // console.log("左边完成");
}) })
.start(); .start();
cc.tween(this.openNode.children[1]) cc.tween(this.openNode.children[1])
.to(0.3, {scaleX: this.openNode.children[1].scaleX < 0?-fill:fill}) .to(0.3, { scaleX: this.openNode.children[1].scaleX < 0 ? -fill : fill })
.call(()=>{ .call(() => {
// console.log("右边完成"); // console.log("右边完成");
}) })
.start(); .start();
} }
changeFreeze(){ changeFreeze() {
let numStr = this.freezeNode.getChildByName("num").getComponent(cc.Label); this.freezeNumber -= 1;
let num = parseInt(numStr.string);
num -= 1; if (this.freezeNumber == 0) {
this.freezeNode.getChildByName("num").getComponent(cc.Label).string = num+""; console.log(this.node.uuid);
if(num == 0){ // this.freezeNode.parent.active = false;
this.freezeNode.parent.active = false; this.resetFreeze();
}
else {
NumberToImage.numberToImageNodes(this.freezeNumber, 20, 8, "lock_", this.freezeNode.getChildByName("num"), false);
} }
} }
downDoor(){ downDoor() {
if(this.openNode){ if (this.openNode) {
if(this.openNode.children[0].scaleX == 1) if (this.openNode.children[0].scaleX == 1)
return; return;
} }
if(this.freezeNode){ if (this.freezeNode) {
if(this.freezeNode.active == true) if (this.freezeNode.active == true)
return; return;
} }
this.node.opacity = 0; this.node.opacity = 0;
if(this.special == WallSpecial.){ if (this.special == WallSpecial.) {
this.node.parent.getChildByName("star").y -= 10; this.node.parent.getChildByName("star").y -= 10;
} }
this.node.parent.getChildByName("down").active = true; this.node.parent.getChildByName("down").active = true;
} }
upDoor(){ upDoor() {
if(this.special == WallSpecial.){ if (this.special == WallSpecial.) {
this.node.parent.getChildByName("star").y += 10; this.node.parent.getChildByName("star").y += 10;
} }
this.node.parent.getChildByName("down").active = false; this.node.parent.getChildByName("down").active = false;
this.node.opacity = 250; this.node.opacity = 250;
} }
resetFreeze() {
this.special = 0;
if (this.freezeNode) {
this.freezeNode.active = false;
}
// if (this.wall_Info.length != 0) {
// let spine = cc.instantiate(this.freezeSpine);
// spine.parent = this.node.parent;
// spine.setPosition(this.node.width / 2 + this.node.x + 60 / 2 * (this.wall_Info.length - 1), this.node.height / 2 + this.node.y);
// spine.getComponent(sp.Skeleton).setAnimation(1, "bingkuai", false);
// console.log("添加一个动画", spine.getPosition());
// }
}
// update (dt) {} // update (dt) {}
} }

View File

@ -572,8 +572,9 @@ export default class Utils {
let setData = { let setData = {
uid: cc.fx.GameConfig.GM_INFO.uid, uid: cc.fx.GameConfig.GM_INFO.uid,
action: 'save', action: 'save',
coinAmount: parseInt(cc.fx.GameConfig.GM_INFO.coin) coinAmount: Math.floor(cc.fx.GameConfig.GM_INFO.coin)
} }
console.log("服务器:上传金币", Math.floor(cc.fx.GameConfig.GM_INFO.coin));
Utils.POST("userCoin", setData, res => { Utils.POST("userCoin", setData, res => {
console.log("获得userCoin数据:", res); console.log("获得userCoin数据:", res);
if (res.code === 1) { if (res.code === 1) {

View File

@ -8,7 +8,7 @@
import MapConroler from "../Map"; import MapConroler from "../Map";
import NumberToImage from "../NumberToImage"; import NumberToImage from "../NumberToImage";
const {ccclass, property} = cc._decorator; const { ccclass, property } = cc._decorator;
@ -20,33 +20,36 @@ export default class Freeze extends cc.Component {
@property(cc.Material) @property(cc.Material)
freeze: cc.Material = null; freeze: cc.Material = null;
@property(cc.Prefab)
ice: cc.Prefab = null;
// mapInfo: number[][] = []; // mapInfo: number[][] = [];
onLoad () { onLoad() {
} }
start () { start() {
} }
init(time,type){ init(time, type) {
if(time) this.time = time; if (time) this.time = time;
this.node.getChildByName("time").active = true; this.node.getChildByName("time").active = true;
NumberToImage.numberToImageNodes(this.time,40,25,"ice_",this.node.getChildByName("time"),false); NumberToImage.numberToImageNodes(this.time, 40, 25, "ice_", this.node.getChildByName("time"), false);
// this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString(); // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
} }
reduce(number){ reduce(number) {
this.time -= number; this.time -= number;
if(this.time <= 0) this.time = 0 if (this.time <= 0) this.time = 0
NumberToImage.numberToImageNodes(this.time,40,25,"ice_",this.node.getChildByName("time"),false); NumberToImage.numberToImageNodes(this.time, 40, 25, "ice_", this.node.getChildByName("time"), false);
// this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString(); // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
if(this.time <= 0){ if (this.time <= 0) {
this.node.getChildByName("bingkuai").active = true; this.node.getChildByName("bingkuai").active = true;
const skeleton = this.node.getChildByName("bingkuai").getComponent(sp.Skeleton); const skeleton = this.node.getChildByName("bingkuai").getComponent(sp.Skeleton);
skeleton.setAnimation(1,"bingkuai",false); skeleton.setAnimation(1, "bingkuai", false);
this.node.getChildByName("icon").active = true; this.node.getChildByName("icon").active = true;
this.node.getChildByName("time").active = false; this.node.getChildByName("time").active = false;
cc.tween(this.node.getChildByName("icon")) cc.tween(this.node.getChildByName("icon"))

View File

@ -0,0 +1,129 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "bingkuai",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
}
],
"_prefab": {
"__id__": 3
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "sp.Skeleton",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_materials": [
{
"__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
}
],
"paused": false,
"defaultSkin": "default",
"defaultAnimation": "",
"_preCacheMode": 0,
"_cacheMode": 0,
"loop": false,
"premultipliedAlpha": false,
"timeScale": 1,
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_skeletonCache": null,
"_animationName": "",
"_animationQueue": [],
"_headAniInfo": null,
"_playTimes": 0,
"_isAniComplete": true,
"_N$skeletonData": {
"__uuid__": "b98ab73e-af9c-47fa-862c-144da3071249"
},
"_N$_defaultCacheMode": 0,
"_N$debugSlots": false,
"_N$debugBones": false,
"_N$debugMesh": false,
"_N$useTint": false,
"_N$enableBatch": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "",
"sync": false
}
]

View File

@ -0,0 +1,9 @@
{
"ver": "1.3.2",
"uuid": "f8f19cf0-280d-4872-a743-a54314eec6a8",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@ -39,19 +39,12 @@
], ],
"WALL_INFO": [ "WALL_INFO": [
[ [
{
"id": 0,
"num": 8,
"color": 10,
"special": 0,
"length": 3
},
{ {
"id": 1, "id": 1,
"num": 10, "num": 10,
"color": 10, "color": 10,
"special": 0, "special": 0,
"length": 0 "length": 2
}, },
{ {
"id": 1, "id": 1,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff