更新
This commit is contained in:
parent
1575fea359
commit
fd29149380
File diff suppressed because it is too large
Load Diff
|
@ -478,7 +478,7 @@ export default class Block extends cc.Component {
|
||||||
|
|
||||||
if (jg >= 0) {
|
if (jg >= 0) {
|
||||||
this.over = true;
|
this.over = true;
|
||||||
MapConroler._instance.changeState();
|
MapConroler._instance.changeState(true);
|
||||||
this.removeBoxCollider();
|
this.removeBoxCollider();
|
||||||
this.removeMapBlock();
|
this.removeMapBlock();
|
||||||
this.removeAction(jg, type);
|
this.removeAction(jg, type);
|
||||||
|
|
|
@ -807,15 +807,19 @@ export default class JiaZai extends cc.Component {
|
||||||
console.log("到期");
|
console.log("到期");
|
||||||
cc.fx.GameConfig.GM_INFO.hp_Max = 5;
|
cc.fx.GameConfig.GM_INFO.hp_Max = 5;
|
||||||
//如果体力大于5,设置为5,小于5,设置为体力值
|
//如果体力大于5,设置为5,小于5,设置为体力值
|
||||||
if (cc.fx.GameConfig.GM_INFO.hp >= 5) {
|
if (cc.fx.GameConfig.GM_INFO.hp > 5) {
|
||||||
cc.fx.GameConfig.GM_INFO.hp = 5;
|
cc.fx.GameConfig.GM_INFO.hp = 5;
|
||||||
|
cc.fx.GameTool.setUserHealth(0, (data) => {
|
||||||
|
cc.fx.GameTool.getHealth(null);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.updateCoin();
|
setTimeout(() => {
|
||||||
this.setHealthInfo(false);
|
this.updateCoin();
|
||||||
this.startTimeCutDown();
|
this.setHealthInfo(false);
|
||||||
cc.fx.GameTool.setUserHealth(0, (data) => {
|
this.startTimeCutDown();
|
||||||
cc.fx.GameTool.getHealth(null);
|
}, 300);
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (data.data != null && data.code == 0) {
|
if (data.data != null && data.code == 0) {
|
||||||
console.log("未到期已领取");
|
console.log("未到期已领取");
|
||||||
|
@ -830,6 +834,13 @@ export default class JiaZai extends cc.Component {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.openRewardWindow(rewardData);
|
this.openRewardWindow(rewardData);
|
||||||
}, 500);
|
}, 500);
|
||||||
|
const dataTemp = {
|
||||||
|
change_reason: "month",
|
||||||
|
id: "1001",
|
||||||
|
num: 500,
|
||||||
|
compensate: false
|
||||||
|
}
|
||||||
|
cc.fx.GameTool.shushu_Track("resource_get", dataTemp);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,6 +143,7 @@ export default class MapConroler extends cc.Component {
|
||||||
|
|
||||||
cc.fx.GameConfig.GM_INFO.review = 0;
|
cc.fx.GameConfig.GM_INFO.review = 0;
|
||||||
cc.fx.GameConfig.GM_INFO.reviewBoom = 0;
|
cc.fx.GameConfig.GM_INFO.reviewBoom = 0;
|
||||||
|
cc.fx.GameConfig.GM_INFO.reviewDoor = 0;
|
||||||
cc.fx.GameConfig.GM_INFO.gameState = true;
|
cc.fx.GameConfig.GM_INFO.gameState = true;
|
||||||
this.mask.opacity = 0;
|
this.mask.opacity = 0;
|
||||||
this.node.getChildByName("Adhesive").zIndex = 500;
|
this.node.getChildByName("Adhesive").zIndex = 500;
|
||||||
|
@ -1187,18 +1188,20 @@ export default class MapConroler extends cc.Component {
|
||||||
return jg;
|
return jg;
|
||||||
}
|
}
|
||||||
|
|
||||||
changeState() {
|
changeState(type) {
|
||||||
if (this.openWall.length != 0) {
|
if (this.openWall.length != 0) {
|
||||||
for (let i = 0; i < this.openWall.length; i++) {
|
for (let i = 0; i < this.openWall.length; i++) {
|
||||||
this.openWall[i].getChildByName("wall").getComponent("Wall").changeLock();
|
this.openWall[i].getChildByName("wall").getComponent("Wall").changeLock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (type) {
|
||||||
if (this.freezeWall.length != 0) {
|
if (this.freezeWall.length != 0) {
|
||||||
for (let i = 0; i < this.freezeWall.length; i++) {
|
for (let i = 0; i < this.freezeWall.length; i++) {
|
||||||
this.freezeWall[i].getChildByName("wall").getComponent("Wall").changeFreeze();
|
this.freezeWall[i].getChildByName("wall").getComponent("Wall").changeFreeze();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//检测是否可以通过门
|
//检测是否可以通过门
|
||||||
|
@ -1644,6 +1647,10 @@ export default class MapConroler extends cc.Component {
|
||||||
if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) coin = 1000;
|
if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) coin = 1000;
|
||||||
else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) coin = 1500;
|
else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) coin = 1500;
|
||||||
}
|
}
|
||||||
|
else if (type == "lock") {
|
||||||
|
if (cc.fx.GameConfig.GM_INFO.reviewDoor == 1) coin = 1000;
|
||||||
|
else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 2) coin = 1500;
|
||||||
|
}
|
||||||
data.coin = -coin;
|
data.coin = -coin;
|
||||||
// console.log("自身金币:",cc.fx.GameConfig.GM_INFO.coin,"消耗金币:",coin);
|
// console.log("自身金币:",cc.fx.GameConfig.GM_INFO.coin,"消耗金币:",coin);
|
||||||
if (cc.fx.GameConfig.GM_INFO.coin < Math.abs(coin)) {
|
if (cc.fx.GameConfig.GM_INFO.coin < Math.abs(coin)) {
|
||||||
|
@ -1681,6 +1688,11 @@ export default class MapConroler extends cc.Component {
|
||||||
if (cc.fx.GameConfig.GM_INFO.reviewBoom < 2)
|
if (cc.fx.GameConfig.GM_INFO.reviewBoom < 2)
|
||||||
cc.fx.GameConfig.GM_INFO.reviewBoom += 1;
|
cc.fx.GameConfig.GM_INFO.reviewBoom += 1;
|
||||||
}
|
}
|
||||||
|
else if (data.type == "lock") {
|
||||||
|
this.changeState(true);
|
||||||
|
if (cc.fx.GameConfig.GM_INFO.reviewDoor < 2)
|
||||||
|
cc.fx.GameConfig.GM_INFO.reviewDoor += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.gameOver = false;
|
this.gameOver = false;
|
||||||
|
@ -1817,6 +1829,11 @@ export default class MapConroler extends cc.Component {
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false;
|
this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false;
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false;
|
this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false;
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = true;
|
this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = true;
|
||||||
|
let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").getChildByName("buyBtn");
|
||||||
|
buyBtn.getChildByName("coin1").active = buyBtn.getChildByName("coin2").active = buyBtn.getChildByName("coin3").active = false;
|
||||||
|
if (cc.fx.GameConfig.GM_INFO.reviewDoor == 0) buyBtn.getChildByName("coin1").active = true;
|
||||||
|
else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 1) buyBtn.getChildByName("coin2").active = true;
|
||||||
|
else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 2) buyBtn.getChildByName("coin3").active = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, time);
|
}, time);
|
||||||
|
@ -2786,8 +2803,41 @@ export default class MapConroler extends cc.Component {
|
||||||
// .start();
|
// .start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//判断方块是否可以正常通过门
|
||||||
|
blockCanPass(block, wall) {
|
||||||
|
let jg = false;
|
||||||
|
let heng = block.getComponent("Block").heng;
|
||||||
|
let shu = block.getComponent("Block").shu;
|
||||||
|
let direction = wall.node.parent.name;
|
||||||
|
if (direction == "left" || direction == "right") {
|
||||||
|
if (wall.wall_Info.length >= shu) {
|
||||||
|
jg = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (wall.wall_Info.length >= heng) {
|
||||||
|
jg = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!jg) {
|
||||||
|
console.log("普通快:不可通过");
|
||||||
|
}
|
||||||
|
return jg;
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断方块是否是可移动类型
|
||||||
|
blockCanMove(block) {
|
||||||
|
if (block.getComponent("Block").type == 10 || block.getComponent("Block").type == 3
|
||||||
|
|| block.getComponent("Block").type == 4) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//提前判断游戏结束
|
//提前判断游戏结束
|
||||||
predict_End() {
|
predict_End() {
|
||||||
|
//return true;
|
||||||
console.log("提前判断游戏结束");
|
console.log("提前判断游戏结束");
|
||||||
let result = false;
|
let result = false;
|
||||||
for (let i = 0; i < this.blocks.length; i++) {
|
for (let i = 0; i < this.blocks.length; i++) {
|
||||||
|
@ -2842,37 +2892,6 @@ export default class MapConroler extends cc.Component {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断方块是否可以正常通过门
|
|
||||||
blockCanPass(block, wall) {
|
|
||||||
let jg = false;
|
|
||||||
let heng = block.getComponent("Block").heng;
|
|
||||||
let shu = block.getComponent("Block").shu;
|
|
||||||
let direction = wall.node.parent.name;
|
|
||||||
if (direction == "left" || direction == "right") {
|
|
||||||
if (wall.wall_Info.length >= shu) {
|
|
||||||
jg = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (wall.wall_Info.length >= heng) {
|
|
||||||
jg = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!jg) {
|
|
||||||
console.log("普通快:不可通过");
|
|
||||||
}
|
|
||||||
return jg;
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断方块是否是可移动类型
|
|
||||||
blockCanMove(block) {
|
|
||||||
if (block.getComponent("Block").type == 10 || block.getComponent("Block").type == 3
|
|
||||||
|| block.getComponent("Block").type == 4) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
update(dt) {
|
update(dt) {
|
||||||
|
|
||||||
|
|
|
@ -640,6 +640,12 @@ var GameTool = {
|
||||||
"timestamp": oldTime
|
"timestamp": oldTime
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (cc.fx.GameConfig.GM_INFO.hp == cc.fx.GameConfig.GM_INFO.hp_Max && health == 0) {
|
||||||
|
healthInfo = {
|
||||||
|
"health": cc.fx.GameConfig.GM_INFO.hp,
|
||||||
|
"timestamp": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
healthInfo = {
|
healthInfo = {
|
||||||
"health": cc.fx.GameConfig.GM_INFO.hp,
|
"health": cc.fx.GameConfig.GM_INFO.hp,
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 1080,
|
"width": 1080,
|
||||||
"height": 2340
|
"height": 1920
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
|
@ -178,7 +178,7 @@
|
||||||
"__uuid__": "22372cf5-9d4b-4926-ace8-921c11cf8dd5"
|
"__uuid__": "22372cf5-9d4b-4926-ace8-921c11cf8dd5"
|
||||||
},
|
},
|
||||||
"_type": 0,
|
"_type": 0,
|
||||||
"_sizeMode": 1,
|
"_sizeMode": 0,
|
||||||
"_fillType": 0,
|
"_fillType": 0,
|
||||||
"_fillCenter": {
|
"_fillCenter": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
|
@ -204,8 +204,8 @@
|
||||||
"_alignFlags": 45,
|
"_alignFlags": 45,
|
||||||
"_left": 0,
|
"_left": 0,
|
||||||
"_right": 0,
|
"_right": 0,
|
||||||
"_top": -210,
|
"_top": 0,
|
||||||
"_bottom": -210,
|
"_bottom": 0,
|
||||||
"_verticalCenter": 0,
|
"_verticalCenter": 0,
|
||||||
"_horizontalCenter": 0,
|
"_horizontalCenter": 0,
|
||||||
"_isAbsLeft": true,
|
"_isAbsLeft": true,
|
||||||
|
@ -440,7 +440,7 @@
|
||||||
"ctor": "Float64Array",
|
"ctor": "Float64Array",
|
||||||
"array": [
|
"array": [
|
||||||
0,
|
0,
|
||||||
-395.349,
|
-395.34899999999993,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user