Compare commits

..

No commits in common. "f311e7624dec6372e31d9716d1e87e06cae1627b" and "c3d141fa6acc67501d07c369017f20cd7d4c5197" have entirely different histories.

9 changed files with 91 additions and 227 deletions

View File

@ -964,9 +964,15 @@
"mask": {
"__id__": 80
},
"iceLabel": null,
"hammerLabel": null,
"magicLabel": null,
"iceLabel": {
"__id__": 76
},
"hammerLabel": {
"__id__": 27
},
"magicLabel": {
"__id__": 44
},
"iceNode": {
"__id__": 71
},

View File

@ -176,7 +176,7 @@ export default class Block extends cc.Component {
this.type = block_Info.type;
this.color = block_Info.color;
this.blockId = block_Info.id;
//console.log("方块类型",this.type,"方块颜色",this.color,"方块ID",this.blockId);
console.log("方块类型",this.type,"方块颜色",this.color,"方块ID",this.blockId);
// if(posX&&posY){
// this.posX = posX;
// this.posY = posY;
@ -518,7 +518,7 @@ export default class Block extends cc.Component {
this.block_Info.node = null;
}
else if(this.type == BlockType.){
this.node.getChildByName("boom").getComponent("Boom").destroyBoom();
this.node.getChildByName("boom").getComponent("Boom").stopBoom();
}
@ -757,7 +757,7 @@ export default class Block extends cc.Component {
self.block_Info.node.getComponent("Block").posY,false);
}
else if(self.type == BlockType.){
this.node.getChildByName("boom").getComponent("Boom").destroyBoom();
this.node.getChildByName("boom").getComponent("Boom").stopBoom();
}
MapConroler._instance.nextLevel();

View File

@ -72,9 +72,6 @@ private heathScheduleCallback: Function = null;
else if(version == "正式版"){
this.node.getChildByName("Load").getChildByName("New EditBox").active = false
}
else{
this.node.getChildByName("Load").getChildByName("New EditBox").active = true;
}
// 预加载 shop 预制体
if (!JiaZai.cachedShopPrefab) {
cc.assetManager.loadBundle('shop', (err: Error, bundle: cc.AssetManager.Bundle) => {
@ -310,12 +307,6 @@ stopHeathTimeCutDown() {
this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false);
cc.fx.GameConfig.LEVEL_INFO_init(true, 1000);
}
else{
if(this.custom.string != ""){
cc.fx.GameConfig.GM_INFO.level = parseInt(this.custom.string) - 1;
// cc.fx.StorageMessage.setStorage("level",cc.fx.GameConfig.GM_INFO.level.toString());
cc.fx.GameConfig.LEVEL_INFO_init(true);
}
else{
cc.fx.AudioManager._instance.playEffect("zhuan1", null);
this.node.getChildByName("zhuanchang").active = true;
@ -323,7 +314,6 @@ stopHeathTimeCutDown() {
cc.fx.GameConfig.LEVEL_INFO_init(true, 1000);
}
}
}

View File

@ -73,7 +73,9 @@ export default class MapConroler extends cc.Component {
@property(cc.Node)
freezeMask: cc.Node = null;
//第一关引导动画
@property(cc.Node)
guide: cc.Node = null;
@property(cc.Node)
coinPop: cc.Node = null;
@ -152,10 +154,10 @@ export default class MapConroler extends cc.Component {
this.add_Time = 0;
//this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
// this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
// this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
this.setPropNum();
this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
// this.setPropNum();
// cc.game.addPersistRootNode(this.node);
MapConroler._instance = this;
}
@ -179,34 +181,30 @@ export default class MapConroler extends cc.Component {
}
//道具数量
setPropNum() {
//如果道具数量大于0显示 cc.fx.GameConfig.GM_INFO.freezeAmount如果为零显示'mul10'
if(cc.fx.GameConfig.GM_INFO.freezeAmount > 0) {
this.iceNode.children[0].active = false;
this.iceNode.children[1].active = true;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.freezeAmount, 35, 15, "mul", this.iceNode.children[1], true);
} else {
this.iceNode.children[0].active = true
this.iceNode.children[1].active = false;
}
if(cc.fx.GameConfig.GM_INFO.hammerAmount > 0) {
this.hammerNode.children[1].active = true;
this.hammerNode.children[0].active = false;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hammerAmount, 35, 15, "mul", this.hammerNode.children[1], true);
} else {
this.hammerNode.children[0].active = true;
this.hammerNode.children[1].active = false;
}
if(cc.fx.GameConfig.GM_INFO.magicAmount > 0) {
this.magicNode.children[1].active = true;
this.magicNode.children[0].active = false;
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.magicAmount, 35, 15, "mul", this.magicNode.children[1], true);
} else {
this.magicNode.children[0].active = true
this.magicNode.children[1].active = false;
}
}
// setPropNum() {
// //如果道具数量大于0显示 cc.fx.GameConfig.GM_INFO.freezeAmount如果为零显示'mul10'
// if(cc.fx.GameConfig.GM_INFO.freezeAmount == 0) {
// this.iceNode.children[1].active = true;
// this.iceNode.children[2].active = true;
// NumberToImage.numberToImageNodes(13, 18,15, "mul", this.iceNode.children[2], false);
// } else {
// this.iceNode.children[0].active = true
// }
// if(cc.fx.GameConfig.GM_INFO.hammerAmount == 0) {
// this.hammerNode.children[1].active = true;
// this.hammerNode.children[2].active = true;
// NumberToImage.numberToImageNodes(1, 18, 15, "mul", this.hammerNode.children[2], true);
// } else {
// this.hammerNode.children[0].active = true
// }
// if(cc.fx.GameConfig.GM_INFO.magicAmount == 0) {
// this.magicNode.children[1].active = true;
// this.magicNode.children[2].active = true;
// NumberToImage.numberToImageNodes(34, 18, 15, "mul", this.magicNode.children[2], true);
// } else {
// this.magicNode.children[0].active = true
// }
// }
startUpdate() {
if (this.gameStart == false) {
@ -215,6 +213,16 @@ export default class MapConroler extends cc.Component {
console.log("准备进入下一关,发送下一关进入");
cc.fx.GameTool.shushu_Track("enter_stage");
this.startTimeCutDown();
// if (cc.fx.GameConfig.GM_INFO.level + 1 == 1) {
// this.guide.getComponent(cc.Animation).stop();
// this.guide.active = false;}
console.log("开始游戏倒计时");
for (let i = 0; i < this.blocks.length; i++) {
if (this.blocks[i].getComponent("Block").type == 6) {
this.blocks[i].getChildByName("boom").getComponent("Boom").startBoom();
}
}
}
}
@ -305,7 +313,13 @@ export default class MapConroler extends cc.Component {
this.mapBlocksWall[i].push(block);
}
}
if(cc.fx.GameConfig.GM_INFO.level + 1 == 10000) {
this.guide.active = true;
this.guide.zIndex = 1000;
this.guide.getComponent(cc.Animation).play();
}
this.wallInit();
this.blockInit();
@ -1480,7 +1494,7 @@ export default class MapConroler extends cc.Component {
console.log("复活回调函数内", data);
cc.fx.GameTool.changeCoin(data);
MiniGameSdk.API.showToast("继续游戏");
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
if (cc.fx.GameConfig.GM_INFO.review < 2)
cc.fx.GameConfig.GM_INFO.review += 1;
@ -1631,7 +1645,6 @@ export default class MapConroler extends cc.Component {
//开始倒计时
startTimeCutDown() {
this.startBoom();
this.scheduleCallback = function () {
if (this.pause) return;
if (this.timeNumber <= 0) {
@ -1684,7 +1697,7 @@ export default class MapConroler extends cc.Component {
if (!this.node.parent.getChildByName("Ice").active && !this.pause) {
const timestamp = Date.now();
this.freezeMask.active = true;
this.stopBoom();
this.pause = true;
this.node.parent.getChildByName("Ice").active = true;
// this.node.parent.getChildByName("Top").getChildByName("Ice").active = true;
@ -1692,8 +1705,7 @@ export default class MapConroler extends cc.Component {
cc.fx.GameConfig.GM_INFO.freezeAmount -= 1;
if (cc.fx.GameConfig.GM_INFO.freezeAmount < 0)
cc.fx.GameConfig.GM_INFO.freezeAmount = 0;
this.setPropNum();
// this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
let propInfo = cc.fx.StorageMessage.getStorage("prop");
propInfo.freezeAmount = cc.fx.GameConfig.GM_INFO.freezeAmount;
propInfo.timestamp = timestamp;
@ -1722,15 +1734,12 @@ export default class MapConroler extends cc.Component {
this.node.parent.getChildByName("Ice").active = false;
// this.node.parent.getChildByName("Top").getChildByName("Ice").active = false;
this.pause = false;
this.startBoom();
// this.startTimeCutDown();
}
}
handleBuySuccess(data) {
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
this.pause = false;
this.startBoom();
const timestamp = Date.now();
// console.log("回调函数内:",this.pause);
let freezeBtn = this.node.parent.getChildByName("Bottom").getChildByName("timeBtn");
@ -1747,8 +1756,7 @@ export default class MapConroler extends cc.Component {
cc.fx.StorageMessage.setStorage("prop", propInfo);
this.node.parent.parent.parent.getComponent("SceneManager").closePropBuy();
setTimeout(() => {
this.setPropNum();
// this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
MiniGameSdk.API.showToast("购买冻结时间道具成功");
}, 200);
@ -1763,8 +1771,7 @@ export default class MapConroler extends cc.Component {
this.node.parent.parent.parent.getComponent("SceneManager").closePropBuy();
setTimeout(() => {
MiniGameSdk.API.showToast("购买锤子道具成功");
this.setPropNum();
// this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
}, 200);
}
@ -1776,8 +1783,7 @@ export default class MapConroler extends cc.Component {
cc.fx.StorageMessage.setStorage("prop", propInfo);
this.node.parent.parent.parent.getComponent("SceneManager").closePropBuy();
setTimeout(() => {
this.setPropNum();
// this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
MiniGameSdk.API.showToast("购买魔法棒道具成功");
}, 200);
@ -1818,8 +1824,7 @@ export default class MapConroler extends cc.Component {
cc.fx.GameConfig.GM_INFO.hammerAmount -= 1;
if (cc.fx.GameConfig.GM_INFO.hammerAmount < 0)
cc.fx.GameConfig.GM_INFO.hammerAmount = 0;
this.setPropNum();
// this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
let propInfo = cc.fx.StorageMessage.getStorage("prop");
console.log("锤子道具信息:", propInfo);
propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount;
@ -1921,8 +1926,7 @@ export default class MapConroler extends cc.Component {
cc.fx.GameConfig.GM_INFO.magicAmount -= 1;
if (cc.fx.GameConfig.GM_INFO.magicAmount < 0)
cc.fx.GameConfig.GM_INFO.magicAmount = 0;
this.setPropNum();
// this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
let propInfo = cc.fx.StorageMessage.getStorage("prop");
propInfo.magicAmount = cc.fx.GameConfig.GM_INFO.magicAmount;
propInfo.timestamp = timestamp;
@ -2030,11 +2034,9 @@ export default class MapConroler extends cc.Component {
usePause() {
if (this.pause) {
this.pause = false;
this.startBoom();
}
else {
this.pause = true;
this.stopBoom();
}
}
@ -2102,7 +2104,7 @@ export default class MapConroler extends cc.Component {
x = block.x - block.width * 0.33;
}
else if (block.anchorX == 0.66) {
x = block.x - block.width * 0.66;
x = block.x + block.width * 0.66;
}
if (jg == 3) {
name = "right_" + height + "_" + width;
@ -2146,22 +2148,6 @@ export default class MapConroler extends cc.Component {
}
}
startBoom(){
for (let i = 0; i < this.blocks.length; i++) {
if (this.blocks[i].getComponent("Block").type == 6) {
this.blocks[i].getChildByName("boom").getComponent("Boom").startBoom();
}
}
}
stopBoom() {
for (let i = 0; i < this.blocks.length; i++) {
if (this.blocks[i].getComponent("Block").type == 6) {
this.blocks[i].getChildByName("boom").getComponent("Boom").stopBoom();
}
}
}
update(dt) {

View File

@ -264,7 +264,6 @@ export default class SceneManager extends cc.Component {
this.pause.getComponent("btnControl").setTouch(false);
this.node.getChildByName("Pause").active = true;
MapConroler._instance.pause = true;
MapConroler._instance.stopBoom();
}
}
@ -280,13 +279,11 @@ export default class SceneManager extends cc.Component {
this.node.getChildByName("Pause").active = false;
if (MapConroler._instance.node.parent.getChildByName("Ice").active == false) {
MapConroler._instance.pause = false;
MapConroler._instance.startBoom();
}
}
openPropBuy(name) {
MapConroler._instance.pause = true;
MapConroler._instance.stopBoom();
this.btnName = name;
let propWindow = this.node.getChildByName("Game").getChildByName("propWindow");
propWindow.active = true;
@ -331,7 +328,6 @@ export default class SceneManager extends cc.Component {
closePropBuy() {
MapConroler._instance.pause = false;
MapConroler._instance.startBoom();
let freezeBtn = MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("timeBtn");
let hammerBtn = MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("destroyBtn");
let magicBtn = MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("magicBtn");

View File

@ -837,7 +837,7 @@ var GameTool = {
price = 12800;
MiniGameSdk.API.showToast("充值成功获得32000金币");
break;
case "gold_5":
case "gold_pack_5":
cc.fx.GameTool.changeCoin(100000);
coin = 100000;
price = 32800;

View File

@ -38,17 +38,12 @@ export default class Boom extends cc.Component {
this.schedule(this.updateTime, 1);
}
destroyBoom(){
stopBoom(){
this.unschedule(this.updateTime);
this.node.parent.getComponent("Block").resetFreeze();
this.node.destroy();
}
stopBoom(){
this.unschedule(this.updateTime);
}
updateTime(){
this.time --;
@ -56,7 +51,6 @@ export default class Boom extends cc.Component {
if(this.time <= 0){
this.unschedule(this.updateTime);
this.node.getChildByName("zhandan").active = true;
this.node.getChildByName("bg").active = false;
const skeleton = this.node.getChildByName("zhandan").getComponent(sp.Skeleton);
skeleton.setAnimation(1,"eff",false);
// 监听动画完成事件

View File

@ -21,23 +21,20 @@
"__id__": 2
},
{
"__id__": 5
},
{
"__id__": 7
"__id__": 4
}
],
"_active": true,
"_components": [
{
"__id__": 10
"__id__": 7
},
{
"__id__": 11
"__id__": 8
}
],
"_prefab": {
"__id__": 12
"__id__": 9
},
"_opacity": 255,
"_color": {
@ -86,115 +83,6 @@
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 62,
"height": 95
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0.614,
15.971,
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__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e22aadda-4f7e-403a-a1e6-d5374fc2862a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "d2adfa00-68ea-4d63-97a0-44fca153a2d7"
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "4ahWLpW2tD8LfIbT5i2bbo",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "time",
@ -206,7 +94,7 @@
"_active": false,
"_components": [],
"_prefab": {
"__id__": 6
"__id__": 3
},
"_opacity": 255,
"_color": {
@ -277,11 +165,11 @@
"_active": false,
"_components": [
{
"__id__": 8
"__id__": 5
}
],
"_prefab": {
"__id__": 9
"__id__": 6
},
"_opacity": 255,
"_color": {
@ -335,7 +223,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
"__id__": 4
},
"_enabled": true,
"_materials": [
@ -398,7 +286,9 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "e22aadda-4f7e-403a-a1e6-d5374fc2862a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
@ -410,7 +300,9 @@
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_atlas": {
"__uuid__": "d2adfa00-68ea-4d63-97a0-44fca153a2d7"
},
"_id": ""
},
{

View File

@ -35,7 +35,7 @@ export default class NewClass extends cc.Component {
{ product_id: "gold_2", name: "金币包2", price: 3600, coin:8000, title: "" },
{ product_id: "gold_3", name: "金币包3", price: 6800, coin:16000, title: "" },
{ product_id: "gold_4", name: "金币包4", price: 12800, coin:32000, title: "" },
{ product_id: "gold_5", name: "金币包5", price: 32800, coin:100000, title: "" },
{ product_id: "gold_pack_5", name: "金币包5", price: 32800, coin:100000, title: "" },
{ product_id: "gold_6", name: "金币包6", price: 64800, coin:240000, title: "" },
];
for (let i = 1; i <= 6 && i < this.itemList.children.length; i++) {
@ -97,8 +97,8 @@ export default class NewClass extends cc.Component {
case "gold_4":
price = 12800;
break;
case "gold_5":
price = 32800;
case "gold_pack_5":
price = 100;
break;
case "gold_6":
price = 64800;