Commit fb23390f authored by Lwd's avatar Lwd

aaaa

parent c4b74ecb
This diff is collapsed.
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// Learn life-cycle callbacks: // Learn life-cycle callbacks:
// - 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 { asyncDelay, RandomInt } from "../common/utils"; import { asyncDelay, RandomInt, showFireworks } from "../common/utils";
var effect = cc.Class({ var effect = cc.Class({
extends: cc.Component, extends: cc.Component,
...@@ -25,6 +25,17 @@ var effect = cc.Class({ ...@@ -25,6 +25,17 @@ var effect = cc.Class({
g.speaker.inst.play_congratulation(); g.speaker.inst.play_congratulation();
}, },
showEffect2: function () {
const bg = cc.find('Canvas/bg/connent');
showFireworks(bg, cc.find('RibbonNodeBase').children, cc.v2(0, -400), cc.v2(0, 1000), 200, 200
);
showFireworks(bg, cc.find('RibbonNodeBase').children, cc.v2(-600, -400), cc.v2(200, 1000), 200, 200
);
showFireworks(bg, cc.find('RibbonNodeBase').children, cc.v2(600, -400), cc.v2(-200, 1000), 200, 200
);
},
async showOneFirework(pos, parentNode, nodeList) { async showOneFirework(pos, parentNode, nodeList) {
for (let i = 0; i < 3; i++) { for (let i = 0; i < 3; i++) {
this.showFirework(pos, parentNode, nodeList, 200, 200, 15); this.showFirework(pos, parentNode, nodeList, 200, 200, 15);
......
...@@ -11,12 +11,6 @@ var game = cc.Class({ ...@@ -11,12 +11,6 @@ var game = cc.Class({
displayName: "预制体" displayName: "预制体"
}, },
contentArr: {
default: null,
type: cc.Node,
displayName: "底下内容"
},
contentArr_2: { contentArr_2: {
default: [], default: [],
type: cc.Node, type: cc.Node,
...@@ -114,17 +108,17 @@ var game = cc.Class({ ...@@ -114,17 +108,17 @@ var game = cc.Class({
g.data_mgr.nowNum = itemArr.length; g.data_mgr.nowNum = itemArr.length;
for (var i = 0; i < itemArr.length; i++) { for (var i = 0; i < itemArr.length; i++) {
let newItem_0 = cc.instantiate(this.Item_0[this.idx]); let newItem_0 = cc.instantiate(this.Item_0[itemArr.length > 14 ? 0 : 1]);
//let newItem_1 = cc.instantiate(this.Item_1); //let newItem_1 = cc.instantiate(this.Item_1);
//更新子项 //更新子项
var com = newItem_0.getChildByName("item").getComponent("item"); var com = newItem_0.getChildByName("item").getComponent("item");
let itemInfo = itemArr[i > 3 ? 1 : i]; let itemInfo = itemArr[i];
com.updateUI(itemInfo); com.updateUI(itemInfo);
newItem_0.active = true; newItem_0.active = true;
// newItem_1.active = true; // newItem_1.active = true;
//设置类别 //设置类别
let sheepInfo = g.data_mgr.getSheep(i > 3 ? 1 : i); let sheepInfo = g.data_mgr.getSheep(i);
newItem_0.getChildByName("item").type = this.checkType(sheepInfo.sheepfoldId); newItem_0.getChildByName("item").type = this.checkType(sheepInfo.sheepfoldId);
// newItem_1.parent = newItem_0; // newItem_1.parent = newItem_0;
// newItem_0.parent = this.contentArr; // newItem_0.parent = this.contentArr;
...@@ -181,17 +175,22 @@ var game = cc.Class({ ...@@ -181,17 +175,22 @@ var game = cc.Class({
//重置UI界面 //重置UI界面
resetUI: function () { resetUI: function () {
// //移除所有子节点 //移除所有子节点
// this.contentArr.removeAllChildren(); this.contentArr_2[0].removeAllChildren();
// //移除所有子节点 this.contentArr_2[1].removeAllChildren();
// this.contentArr_1[0].removeAllChildren(); this.contentArr_1[0].getChildByName("connent_3").getChildByName("Layout").removeAllChildren();
// //移除所有子节点 this.contentArr_1[1].getChildByName("connent_3").getChildByName("Layout").removeAllChildren();
// this.contentArr_1[1].removeAllChildren();
}, },
//重新开始
onBtnReStart: function () {
g.speaker.inst.play_btn();
//移除所有计时器
this.unscheduleAllCallbacks();
//初始化界面
this.UpdataUi();
g.speaker.inst.play_restart();
},
//游戏开始 //游戏开始
gameStart: function () { gameStart: function () {
...@@ -245,15 +244,6 @@ var game = cc.Class({ ...@@ -245,15 +244,6 @@ var game = cc.Class({
} }
}, },
//重新开始
onBtnReStart: function () {
g.speaker.inst.play_btn();
//移除所有计时器
this.unscheduleAllCallbacks();
//初始化界面
this.UpdataUi();
g.speaker.inst.play_restart();
},
onBtnMask: function () { onBtnMask: function () {
if (this.isLoadEnd) { if (this.isLoadEnd) {
......
...@@ -21,6 +21,11 @@ cc.Class({ ...@@ -21,6 +21,11 @@ cc.Class({
type: cc.Node, type: cc.Node,
displayName: "图片" displayName: "图片"
}, },
Item_complete: {
default: null,
type: cc.Node,
displayName: "完成显示"
},
}, },
start: function () { start: function () {
...@@ -95,10 +100,11 @@ cc.Class({ ...@@ -95,10 +100,11 @@ cc.Class({
// console.log("坐标" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y + "是否包含" + isIntersect_1); // console.log("坐标" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y + "是否包含" + isIntersect_1);
if (isIntersect_1) { if (isIntersect_1) {
if (this.node.type == 1) { if (this.node.type == 1) {
this.Item_complete.active = true;
this.node.isComplent = true; this.node.isComplent = true;
g.data_mgr.nowNum -= 1; g.data_mgr.nowNum -= 1;
if (g.data_mgr.nowNum == 0) { if (g.data_mgr.nowNum == 0) {
g.effect.inst.showEffect(); g.effect.inst.showEffect2();
} }
g.speaker.inst.play_good(); g.speaker.inst.play_good();
...@@ -123,10 +129,11 @@ cc.Class({ ...@@ -123,10 +129,11 @@ cc.Class({
} else } else
if (isIntersect_0) { if (isIntersect_0) {
if (this.node.type == 2) { if (this.node.type == 2) {
this.Item_complete.active = true;
this.node.isComplent = true; this.node.isComplent = true;
g.data_mgr.nowNum -= 1; g.data_mgr.nowNum -= 1;
if (g.data_mgr.nowNum == 0) { if (g.data_mgr.nowNum == 0) {
g.effect.inst.showEffect(); g.effect.inst.showEffect2();
} }
g.speaker.inst.play_good(); g.speaker.inst.play_good();
...@@ -196,7 +203,7 @@ cc.Class({ ...@@ -196,7 +203,7 @@ cc.Class({
//点击翻面 //点击翻面
onBtnRotate: function () { onBtnRotate: function () {
//翻面音效 //翻面音效
g.snd_mgr.playEffect(this.eff_btn); g.speaker.inst.play_btn();
var scaleX = this.node.scaleY; var scaleX = this.node.scaleY;
...@@ -206,9 +213,11 @@ cc.Class({ ...@@ -206,9 +213,11 @@ cc.Class({
if (this.Item_name.node.active) { if (this.Item_name.node.active) {
this.Item_name.node.active = false; this.Item_name.node.active = false;
this.Item_photo.active = true; this.Item_photo.active = true;
this.Item_redName.active = false;
} else { } else {
this.Item_name.node.active = true; this.Item_name.node.active = true;
this.Item_photo.active = false; this.Item_photo.active = false;
this.Item_redName.active = true;
} }
}) })
.to(0.3, { scaleX: scaleX }) .to(0.3, { scaleX: scaleX })
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 29, "width": 29,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 1280, "width": 1280,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 1280, "width": 1280,
......
{
"ver": "2.3.5",
"uuid": "f59901e3-76d1-45da-b36f-d3f0a7c6cef3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 36,
"height": 24,
"platformSettings": {},
"subMetas": {
"bg_sahua": {
"ver": "1.0.4",
"uuid": "130348e9-f1a0-4858-8d2a-dfd298bc57f1",
"rawTextureUuid": "f59901e3-76d1-45da-b36f-d3f0a7c6cef3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 36,
"height": 24,
"rawWidth": 36,
"rawHeight": 24,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 548, "width": 548,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 520, "width": 520,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 488, "width": 488,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 520, "width": 520,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 110, "width": 110,
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 308, "width": 154,
"height": 172, "height": 86,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"item_bg2": { "item_bg2": {
......
{
"ver": "2.3.5",
"uuid": "6ba3f108-a477-4fb0-85eb-3483d09cfb16",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 104,
"height": 59,
"platformSettings": {},
"subMetas": {
"item_bg3": {
"ver": "1.0.4",
"uuid": "7cc1176f-4e77-4587-bad7-3ef22aacbb7e",
"rawTextureUuid": "6ba3f108-a477-4fb0-85eb-3483d09cfb16",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 104,
"height": 59,
"rawWidth": 104,
"rawHeight": 59,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 72, "width": 72,
......
{
"ver": "2.3.5",
"uuid": "342b35ae-d6d0-4221-a4e1-098813b75f13",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 36,
"height": 42,
"platformSettings": {},
"subMetas": {
"reStart": {
"ver": "1.0.4",
"uuid": "e0f45385-06ab-42bb-9f92-c2088daa3615",
"rawTextureUuid": "342b35ae-d6d0-4221-a4e1-098813b75f13",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 36,
"height": 42,
"rawWidth": 36,
"rawHeight": 42,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": true,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 535, "width": 535,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment