This commit is contained in:
tothvillar
2026-07-09 15:04:14 +08:00
commit e896e2ead4
1180 changed files with 115132 additions and 0 deletions
@@ -0,0 +1,717 @@
{
"__type__": "cc.AnimationClip",
"_name": "jinbibao",
"_duration": 0.7666666666666667,
"curveData": {
"paths": {
"jb": {
"props": {
"x": [
{
"frame": 0,
"value": -1.362
},
{
"frame": 0.08333333333333333,
"value": 66.018
},
{
"frame": 0.16666666666666666,
"value": 153.769
},
{
"frame": 0.25,
"value": 218.015
},
{
"frame": 0.3333333333333333,
"value": 233.685
}
],
"y": [
{
"frame": 0,
"value": 177.006
},
{
"frame": 0.08333333333333333,
"value": 272.591
},
{
"frame": 0.16666666666666666,
"value": 299.23
},
{
"frame": 0.25,
"value": 191.109
},
{
"frame": 0.3333333333333333,
"value": 53.215
},
{
"frame": 0.4166666666666667,
"value": 79.854
},
{
"frame": 0.5,
"value": 53.215
},
{
"frame": 0.5666666666666667,
"value": 70.452
},
{
"frame": 0.6,
"value": 53.215
}
]
}
},
"jb2": {
"props": {
"x": [
{
"frame": 0.08333333333333333,
"value": -1.362
},
{
"frame": 0.16666666666666666,
"value": 39.379
},
{
"frame": 0.25,
"value": 111.46
},
{
"frame": 0.3333333333333333,
"value": 150.634
},
{
"frame": 0.4166666666666667,
"value": 171.005
}
],
"y": [
{
"frame": 0.08333333333333333,
"value": 177.006
},
{
"frame": 0.16666666666666666,
"value": 260.056
},
{
"frame": 0.25,
"value": 245.953
},
{
"frame": 0.3333333333333333,
"value": 161.336
},
{
"frame": 0.4166666666666667,
"value": 40.679
},
{
"frame": 0.5,
"value": 72.018
},
{
"frame": 0.5833333333333334,
"value": 40.679
},
{
"frame": 0.65,
"value": 56.349
},
{
"frame": 0.6833333333333333,
"value": 40.679
}
],
"opacity": [
{
"frame": 0.06666666666666667,
"value": 0
},
{
"frame": 0.08333333333333333,
"value": 255
}
]
}
},
"jb3": {
"props": {
"x": [
{
"frame": 0,
"value": -1.362
},
{
"frame": 0.08333333333333333,
"value": -101.648
},
{
"frame": 0.16666666666666666,
"value": -197.233
},
{
"frame": 0.25,
"value": -253.644
},
{
"frame": 0.3333333333333333,
"value": -278.716
}
],
"y": [
{
"frame": 0,
"value": 177.006
},
{
"frame": 0.08333333333333333,
"value": 266.323
},
{
"frame": 0.16666666666666666,
"value": 299.229
},
{
"frame": 0.25,
"value": 180.139
},
{
"frame": 0.3333333333333333,
"value": 37.544
},
{
"frame": 0.4166666666666667,
"value": 82.986
},
{
"frame": 0.5,
"value": 37.544
},
{
"frame": 0.5666666666666667,
"value": 50.08
},
{
"frame": 0.6,
"value": 37.544
}
]
}
},
"jb4": {
"props": {
"x": [
{
"frame": 0.03333333333333333,
"value": -1.362
},
{
"frame": 0.11666666666666667,
"value": -43.67
},
{
"frame": 0.2,
"value": -84.411
},
{
"frame": 0.2833333333333333,
"value": -153.358
},
{
"frame": 0.36666666666666664,
"value": -170.595
}
],
"y": [
{
"frame": 0.03333333333333333,
"value": 177.006
},
{
"frame": 0.11666666666666667,
"value": 314.9
},
{
"frame": 0.2,
"value": 361.909
},
{
"frame": 0.2833333333333333,
"value": 272.592
},
{
"frame": 0.36666666666666664,
"value": 125.296
},
{
"frame": 0.45,
"value": 155.068
},
{
"frame": 0.5333333333333333,
"value": 125.296
},
{
"frame": 0.6,
"value": 140.966
},
{
"frame": 0.6333333333333333,
"value": 125.296
}
],
"opacity": [
{
"frame": 0.016666666666666666,
"value": 0
},
{
"frame": 0.03333333333333333,
"value": 255
}
]
}
},
"jb5": {
"props": {
"x": [
{
"frame": 0.06666666666666667,
"value": -1.362
},
{
"frame": 0.15,
"value": 25.277
},
{
"frame": 0.23333333333333334,
"value": 44.08
},
{
"frame": 0.31666666666666665,
"value": 59.75
},
{
"frame": 0.4,
"value": 92.656
}
],
"y": [
{
"frame": 0.06666666666666667,
"value": 177.006
},
{
"frame": 0.15,
"value": 288.261
},
{
"frame": 0.23333333333333334,
"value": 335.27
},
{
"frame": 0.31666666666666665,
"value": 267.89
},
{
"frame": 0.4,
"value": 78.286
},
{
"frame": 0.48333333333333334,
"value": 111.192
},
{
"frame": 0.5666666666666667,
"value": 78.286
},
{
"frame": 0.6333333333333333,
"value": 87.688
},
{
"frame": 0.6666666666666666,
"value": 78.286
}
],
"opacity": [
{
"frame": 0.05,
"value": 0
},
{
"frame": 0.06666666666666667,
"value": 255
}
]
}
},
"jb6": {
"props": {
"x": [
{
"frame": 0.11666666666666667,
"value": -1.362
},
{
"frame": 0.2,
"value": -48.371
},
{
"frame": 0.2833333333333333,
"value": -84.411
},
{
"frame": 0.36666666666666664,
"value": -106.349
},
{
"frame": 0.45,
"value": -112.617
}
],
"y": [
{
"frame": 0.11666666666666667,
"value": 177.006
},
{
"frame": 0.2,
"value": 307.065
},
{
"frame": 0.2833333333333333,
"value": 365.043
},
{
"frame": 0.36666666666666664,
"value": 250.654
},
{
"frame": 0.45,
"value": 78.287
},
{
"frame": 0.5333333333333333,
"value": 108.059
},
{
"frame": 0.6166666666666667,
"value": 78.287
},
{
"frame": 0.6833333333333333,
"value": 97.091
},
{
"frame": 0.7166666666666667,
"value": 78.287
}
],
"opacity": [
{
"frame": 0.1,
"value": 0
},
{
"frame": 0.11666666666666667,
"value": 255
}
]
}
},
"jb7": {
"props": {
"x": [
{
"frame": 0.08333333333333333,
"value": -1.362
},
{
"frame": 0.16666666666666666,
"value": -10.764
},
{
"frame": 0.25,
"value": -34.269
},
{
"frame": 0.3333333333333333,
"value": -43.671
},
{
"frame": 0.4166666666666667,
"value": -57.774
}
],
"y": [
{
"frame": 0.08333333333333333,
"value": 177.006
},
{
"frame": 0.16666666666666666,
"value": 253.788
},
{
"frame": 0.25,
"value": 332.137
},
{
"frame": 0.3333333333333333,
"value": 245.953
},
{
"frame": 0.4166666666666667,
"value": 84.555
},
{
"frame": 0.5,
"value": 114.327
},
{
"frame": 0.5833333333333334,
"value": 84.555
},
{
"frame": 0.65,
"value": 97.091
},
{
"frame": 0.6833333333333333,
"value": 84.555
}
],
"opacity": [
{
"frame": 0.06666666666666667,
"value": 0
},
{
"frame": 0.08333333333333333,
"value": 255
}
]
}
},
"jb8": {
"props": {
"x": [
{
"frame": 0,
"value": -1.362
},
{
"frame": 0.08333333333333333,
"value": -84.412
},
{
"frame": 0.16666666666666666,
"value": -150.225
},
{
"frame": 0.25,
"value": -176.864
},
{
"frame": 0.3333333333333333,
"value": -209.77
}
],
"y": [
{
"frame": 0,
"value": 177.006
},
{
"frame": 0.08333333333333333,
"value": 310.199
},
{
"frame": 0.16666666666666666,
"value": 352.507
},
{
"frame": 0.25,
"value": 245.953
},
{
"frame": 0.3333333333333333,
"value": 100.224
},
{
"frame": 0.4166666666666667,
"value": 150.367
},
{
"frame": 0.5,
"value": 100.224
},
{
"frame": 0.5666666666666667,
"value": 128.43
},
{
"frame": 0.6,
"value": 100.224
}
],
"opacity": [
{
"frame": 0,
"value": 255
}
]
}
},
"jb9": {
"props": {
"x": [
{
"frame": 0.13333333333333333,
"value": -1.362
},
{
"frame": 0.21666666666666667,
"value": 128.697
},
{
"frame": 0.3,
"value": 227.416
},
{
"frame": 0.38333333333333336,
"value": 301.064
}
],
"y": [
{
"frame": 0.13333333333333333,
"value": 177.006
},
{
"frame": 0.21666666666666667,
"value": 349.373
},
{
"frame": 0.3,
"value": 299.23
},
{
"frame": 0.38333333333333336,
"value": 109.626
},
{
"frame": 0.4666666666666667,
"value": 150.367
},
{
"frame": 0.55,
"value": 109.626
},
{
"frame": 0.6166666666666667,
"value": 122.162
},
{
"frame": 0.65,
"value": 109.626
}
],
"opacity": [
{
"frame": 0.11666666666666667,
"value": 0
},
{
"frame": 0.13333333333333333,
"value": 255
}
]
}
},
"jb10": {
"props": {
"x": [
{
"frame": 0.16666666666666666,
"value": -1.362
},
{
"frame": 0.25,
"value": 9.607
},
{
"frame": 0.3333333333333333,
"value": 20.576
},
{
"frame": 0.4166666666666667,
"value": 51.915
},
{
"frame": 0.5,
"value": 53.482
}
],
"y": [
{
"frame": 0.16666666666666666,
"value": 177.006
},
{
"frame": 0.25,
"value": 300.797
},
{
"frame": 0.3333333333333333,
"value": 358.775
},
{
"frame": 0.4166666666666667,
"value": 256.922
},
{
"frame": 0.5,
"value": 50.081
},
{
"frame": 0.5833333333333334,
"value": 81.42
},
{
"frame": 0.6666666666666666,
"value": 50.081
},
{
"frame": 0.7333333333333333,
"value": 62.617
},
{
"frame": 0.7666666666666667,
"value": 50.081
}
],
"opacity": [
{
"frame": 0.15,
"value": 0
},
{
"frame": 0.16666666666666666,
"value": 255
}
]
}
}
}
}
}
@@ -0,0 +1,3 @@
{
"uuid": "19c52696-87da-4b2d-a30f-3cd465c8e21a"
}
@@ -0,0 +1,32 @@
{
"__type__": "cc.AnimationClip",
"_name": "tanchuang",
"_duration": 0.18333333333333332,
"curveData": {
"props": {
"scale": [
{
"frame": 0,
"value": {
"__type__": "cc.Vec2"
}
},
{
"frame": 0.18333333333333332,
"value": {
"__type__": "cc.Vec2",
"x": 1,
"y": 1
}
}
]
},
"paths": {
"New Sprite(Splash)": {
"props": {
"scale": []
}
}
}
}
}
@@ -0,0 +1,3 @@
{
"uuid": "c4632776-aeb6-435b-b456-5a8d8c2136e2"
}
@@ -0,0 +1,55 @@
{
"__type__": "cc.AnimationClip",
"_name": "zhuanchang",
"_duration": 1.75,
"curveData": {
"paths": {
"maskNode": {
"props": {
"scale": [
{
"frame": 0,
"value": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
}
},
{
"frame": 0.4666666666666667,
"value": {
"__type__": "cc.Vec2",
"x": 0.1,
"y": 0.1
}
},
{
"frame": 0.7166666666666667,
"value": {
"__type__": "cc.Vec2",
"x": 0.1,
"y": 0.1
}
},
{
"frame": 1.15,
"value": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
}
},
{
"frame": 1.75,
"value": {
"__type__": "cc.Vec2",
"x": 5,
"y": 5
}
}
]
}
}
}
}
}
@@ -0,0 +1,3 @@
{
"uuid": "557afaa7-e55f-474e-94e2-0f7f58b9c6ed"
}
@@ -0,0 +1,24 @@
{
"__type__": "cc.AnimationClip",
"_name": "huabi",
"_duration": 0.8333333333333334,
"wrapMode": 2,
"curveData": {
"props": {
"angle": [
{
"frame": 0,
"value": -10
},
{
"frame": 0.4166666666666667,
"value": 10
},
{
"frame": 0.8333333333333334,
"value": -10
}
]
}
}
}
@@ -0,0 +1,3 @@
{
"uuid": "d3e7b826-5b87-41ef-816b-f86d7e111a6b"
}
+47
View File
@@ -0,0 +1,47 @@
cc.Class({
extends: cc.Component,
properties: {},
onLoad: function () {},
start: function () {
this.gameBj = null;
},
init: function () {
cc.audioEngine.setMusicVolume(.8);
cc.audioEngine.setEffectsVolume(1);
},
onPlayBjM: function () {
var e = arguments.length > 0 && undefined !== arguments[0] ? arguments[0] : null;
1 == cc.audioEngine.isMusicPlaying() && cc.audioEngine.stopMusic();
var o = this.onGetAudioClips(e);
o && cc.audioEngine.playMusic(o, true);
},
onPlayGameEffect: function (e, o) {
o || (o = false);
var t = this.onGetAudioClips(e);
if (t) {
return cc.audioEngine.playEffect(t, o);
}
},
onPlayBtnEffect: function (e) {
if (0 != cc.global.isPlaySound) {
var o = this.onGetAudioClips(e);
o && cc.audioEngine.playEffect(o);
}
},
pauseAll: function () {
cc.audioEngine.pauseAll();
},
resumeAll: function () {
cc.audioEngine.resumeAll();
},
onStopBjM: function () {
cc.audioEngine.stopMusic();
},
onGetAudioClips: function (e) {
var o = cc.Audios[e];
return o || (console.log("未找到该声音文件:", e), null);
},
onGetAudioTime: function (e) {
this.onGetAudioClips(e);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "c6c318bb-db14-41b1-ae63-a6289b8d0d1b",
"isPlugin": false
}
+19
View File
@@ -0,0 +1,19 @@
cc.Class({
extends: cc.Component,
properties: {},
start: function () {
var e = this;
e.node.active = false;
if (GlobData.isUcMiNiGame || GlobData.is4399MiNiGame && !window.H5Box) {
setTimeout(function () {
e.node.active = true;
}, 3e3);
} else if (window.GameConfig.closebtnYC) {
setTimeout(function () {
e.node.active = true;
}, 3e3);
} else {
e.node.active = true;
}
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "224d2d63-e8d3-4cfd-9496-bb0fce728a87",
"isPlugin": false
}
+16
View File
@@ -0,0 +1,16 @@
cc.Class({
extends: cc.Component,
properties: {},
onLoad: function () {},
start: function () {
this.onActivatePhysicsWorld();
},
onActivatePhysicsWorld: function () {
var e = cc.director.getPhysicsManager();
e.enabled = true;
e.gravity = cc.v2(0, -2e3);
},
onActivateCollisionWorld: function () {
cc.director.getCollisionManager().enabled = true;
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "4a2263e1-0f07-4c14-b300-872e4cde7b82",
"isPlugin": false
}
+181
View File
@@ -0,0 +1,181 @@
cc.Class({
extends: cc.Component,
properties: {
moveSpeed: 100,
gameList: {
default: null,
type: cc.Node,
displayName: "游戏"
},
nameBj: {
default: [],
type: cc.SpriteFrame,
displayName: "游戏名字背景"
},
isHorizontal: false
},
onLoad: function () {
this.contentNode = this.gameList.getChildByName("contentNode");
this.contentNode.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.contentNode.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
this.contentNode.on(cc.Node.EventType.TOUCH_CANCEL, this.onTouchEnd, this);
this.contentNode.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
this.node.getComponent(cc.Widget) && this.node.getComponent(cc.Widget).updateAlignment();
this.gameList || (this.gameList = this.node);
this.gameNameBjIndex = 0;
this.moveSpeed = 80;
this.isGoUp = true;
this.isMayMove = true;
this.showID = 0;
this.changeTime = 0;
if (window.swan && window.GameConfig.iconList && window.GameConfig.packageList) {
if (window.GameConfig.packageList.length <= 0 || window.GameConfig.packageList.length <= 0) {
this.node.active = false;
} else {
this.showIcon();
}
} else {
this.node.active = false;
}
},
start: function () {},
showIcon: function () {
for (var e = 0; e < window.GameConfig.iconList.length; e++) {
var o = this.gameList.getChildByName("contentNode").children[e];
console.log();
o || ((o = cc.instantiate(this.gameList.getChildByName("contentNode").children[0])).parent = this.gameList.getChildByName("contentNode"));
o.showID = e;
var t = o.getChildByName("icon");
window.swan && t.getComponent("ShowImgScript").onShowImg_server(window.GameConfig.iconList[e]);
}
this.gameList.getChildByName("contentNode").getComponent(cc.Layout).updateLayout();
this.maxX = 0;
this.minX = -1 * (this.contentNode.width - this.gameList.width);
this.maxY = this.contentNode.height - this.gameList.height;
this.minY = 0;
},
touchIconCallBack: function (e) {
var o = parseInt(e.target.showID);
if (console.log("showID=", o), window.tt) {
"ios" === window.tt.getSystemInfoSync().platform && window.tt.showToast({
title: " iOS不支持此功能"
});
window.tt.showMoreGamesModal({
appLaunchOptions: [{
appId: "",
query: "foo=bar&baz=qux",
extraData: {}
}],
success: function (e) {},
fail: function (e) {}
});
} else if (window.qg) {
window.qg.navigateToMiniGame({
pkgName: window.GameConfig.packageList[o],
path: "?page=pageB",
extraData: {
from: "脑洞侦探"
},
success: function () {},
fail: function (e) {
console.log(JSON.stringify(e));
}
});
} else {
window.swan && window.swan.navigateToMiniProgram({
appKey: window.GameConfig.packageList[o],
path: "/path/page/0",
extraData: {
from: "脑洞侦探"
},
success: function () {},
fail: function (e) {
console.log(JSON.stringify(e));
}
});
}
},
onJumpToOtherGame: function (e) {
e || (e = 0);
window.swan && window.swan.navigateToMiniProgram({
appKey: window.GameConfig.packageList[e],
path: "/path/page/0",
extraData: {
from: "抢滩夺岛战"
},
success: function () {},
fail: function (e) {
console.log(JSON.stringify(e));
}
});
},
onButtonClick: function (e) {
switch (e.target.name) {
case "btn_close":
this.node.removeFromParent();
}
},
onTouchStart: function (e) {
this.isMayMove = false;
this.firstTouchPoint = this.contentNode.convertToNodeSpaceAR(e.getLocation());
},
onTouchMove: function (e) {
if (1 != this.isMayMove) {
var o = e.getDelta().x;
var t = e.getDelta().y;
if (1 == this.isHorizontal) {
this.contentNode.x += o;
this.contentNode.x <= this.minX && (this.contentNode.x = this.minX);
this.contentNode.x >= this.maxX && (this.contentNode.x = this.maxX);
} else {
this.contentNode.y += t;
this.contentNode.y <= this.minY && (this.contentNode.y = this.minY);
this.contentNode.y >= this.maxY && (this.contentNode.y = this.maxY);
}
}
},
onTouchEnd: function (e) {
if (!this.isMayMove) {
this.isMayMove = true;
var o = this.contentNode.convertToNodeSpaceAR(e.getLocation());
if (this.firstTouchPoint.sub(o).mag() < 10) {
var t = this.contentNode.children;
for (var i = 0; i < t.length; i++) {
var n = t[i];
if (n.getBoundingBox().contains(o)) {
var a = n.showID;
this.onJumpToOtherGame(a);
break;
}
}
}
}
},
update: function (e) {
if (this.isMayMove) {
if (1 == this.isHorizontal) {
if (1 == this.isGoUp) {
this.contentNode.x += this.moveSpeed * e;
if (this.contentNode.x >= this.maxX) {
this.contentNode.x = this.maxX, this.isGoUp = false;
}
} else {
this.contentNode.x -= this.moveSpeed * e;
if (this.contentNode.x <= this.minX) {
this.contentNode.x = this.minX, this.isGoUp = true;
}
}
} else if (1 == this.isGoUp) {
this.contentNode.y += this.moveSpeed * e;
if (this.contentNode.y >= this.maxY) {
this.contentNode.y = this.maxY, this.isGoUp = false;
}
} else {
this.contentNode.y -= this.moveSpeed * e;
if (this.contentNode.y <= this.minY) {
this.contentNode.y = this.minY, this.isGoUp = true;
}
}
}
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "777a4c3f-f765-49e9-aed6-ab59668c4377",
"isPlugin": false
}
+186
View File
@@ -0,0 +1,186 @@
cc.Class({
extends: cc.Component,
properties: {
_UIManage: null,
contentNode: {
default: null,
type: cc.Node,
displayName: "主要内容节点"
},
toolContainer: {
default: null,
type: cc.Node,
displayName: "游戏工具存放容器"
},
liziNode: {
default: [],
type: cc.ParticleSystem,
displayName: "成功粒子效果"
}
},
onLoad: function () {
this.loseNum = 0;
this.yesNum = 0;
this.mouseAgility = 2;
this.isSnipeGunMode = true;
this.levelNode = null;
this.quanEffect = null;
this.isTouch = false;
this.isManual = false;
this.manualTime = 0;
this.mistakeNum = 0;
cc.global._gameManage = this;
cc.global.clearManage = null;
},
start: function () {
cc.global.gamewin = false;
this.clickfaillnum = 0;
cc.PlatformTools.executeVideoRecorder();
cc.PlatformTools.executeShowVIVOInGame();
cc.PlatformTools.executeShowInterstitial();
this.game = cc.global.gameModel;
this.duihaoNode = this.toolContainer.getChildByName("duihao");
this.cuochaNode = this.toolContainer.getChildByName("cuocha");
this.handNode = this.toolContainer.getChildByName("hand");
this.creatorLevel();
},
onUpdataOpen: function () {
this.open = this.toolContainer.getChildByName("huabi");
GlobData.updateSprite(this.open, "game2/shop/player/b_" + cc.playerData.handeType);
},
onMistake: function () {},
creatorLevel: function () {
this.onUpdataOpen();
var e = cc.global.level;
console.log("当前关卡:" + e);
this.contentNode.removeAllChildren();
cc.loader.loadRes("".concat(this.game, "/prefab/level/level_").concat(cc.global.levellist[cc.global.level - 1]), function (e, o) {
if (!e && o instanceof cc.Prefab) {
var t = cc.instantiate(o);
t.parent = this.contentNode;
t.position = cc.v2(0, 0);
this.levelNode = t;
}
}.bind(this));
},
oonBtnClickEvent: function (e) {
var o = this;
cc.global.Source.onPlayBtnEffect("buttonClick");
switch (e.target.name) {
case "back":
if (cc.global.gamewin) {
return;
}
cc.global.zhiyinNode && cc.global.zhiyinNode.showZhuanchang(function () {
cc.global.LoadPreFtabData("".concat(o.game, "/prefab/gameui/").concat(o.game, "_xuanguan"), function () {}.bind(o));
});
break;
case "btn_jbts":
if (cc.playerData.coin >= 100) {
cc.playerData.coin -= 100;
cc.global.savePlayerData();
cc.global.LoadPreFtabData("".concat(this.game, "/prefab/gameui/").concat(this.game, "_TiShi"), function () {}.bind(this));
} else {
cc.global.LoadPreFtabData("prefab/ui/pushCoins_UI", function () {}.bind(this));
}
break;
case "btn_ts2":
cc.PlatformTools.executeShowAwardVideo(function () {
cc.global.LoadPreFtabData("".concat(o.game, "/prefab/gameui/").concat(o.game, "_TiShi"), function () {}.bind(o));
});
break;
case "btn_tg2":
if (cc.global.gamewin) {
return;
}
cc.PlatformTools.executeShowAwardVideo(function () {
if (cc.global.level < cc.global.levellist.length && cc.global.level + 1 > cc.global.levelDate) {
cc.global.levelDate += 1;
if (cc.global.levelDataScript) {
cc.global.levelDataScript.updateData(cc.global.levelDate);
} else {
console.log("没有找到cc.global.levelDataScript");
}
}
if (cc.global.level < cc.global.levellist.length) {
cc.global.level++;
cc.global.zhiyinNode && cc.global.zhiyinNode.showZhuanchang(function () {
cc.director.loadScene("GameScense");
});
} else {
cc.global.zhiyinNode && cc.global.zhiyinNode.showZhuanchang(function () {
cc.director.loadScene("GameMain");
});
}
});
}
},
successLiZi: function () {
cc.global.Source.onPlayGameEffect("winsound");
for (var e = 0; e < this.liziNode.length; e++) {
this.liziNode[e].resetSystem();
}
},
onDuiHaoEffect: function (e) {
var o = this;
if (this.duihaoNode) {
this.successLiZi();
cc.global.isShowTiaoGuan = true;
var t = null;
if (15 == cc.global.levelid) {
t = cc.v2(200, 100);
} else {
t = cc.v2(0, 0);
e && (t = cc.global.onTransitionPosition(e.parent, this.duihaoNode.parent, e.position.clone()));
}
this.duihaoNode.position = t;
this.duihaoNode.scale = 0;
this.duihaoNode.stopAllActions();
cc.tween(this.duihaoNode).to(.1, {
scale: 1,
easing: "elasticOut"
}).delay(2).call(function () {
o.duihaoNode.scale = 0;
}).start();
cc.global.Source.onPlayGameEffect("chenggong");
} else {
console.log("未找到对号节点");
}
},
onChaHao: function (e) {
var o = this;
if (this.cuochaNode) {
this.showTostWindow();
var t = cc.v2(0, 0);
this.cuochaNode.position = t;
this.cuochaNode.scale = 0;
this.cuochaNode.stopAllActions();
cc.tween(this.cuochaNode).to(.05, {
scale: 1,
easing: "elasticOut"
}).delay(.4).call(function () {
o.cuochaNode.scale = 0;
}).start();
cc.global.Source.onPlayGameEffect("mistake");
} else {
console.log("未找到错叉节点");
}
},
onGameWin: function () {
this.scheduleOnce(function () {
console.log("弹出成功界面----");
cc.global.LoadPreFtabData("".concat(this.game, "/prefab/gameui/").concat(this.game, "_victory"), function () {}.bind(this));
}.bind(this), .8);
},
onGameLose: function () {
this.scheduleOnce(function () {
console.log("弹出失败界面----");
cc.global.LoadPreFtabData("".concat(this.game, "/prefab/gameui/").concat(this.game, "_lost"), function () {}.bind(this));
}.bind(this), .8);
},
showTostWindow: function () {
this.clickfaillnum++;
console.log("谈提示框");
this.clickfaillnum % 3 == 0 && cc.global.LoadPreFtabData("".concat(this.game, "/prefab/gameui/").concat(this.game, "_getTiShivideo"), function () {}.bind(this));
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "2edfa424-82e1-4df0-bdb9-4014fc615fe2",
"isPlugin": false
}
+155
View File
@@ -0,0 +1,155 @@
window.GlobData = {
isWinCiShu: 0,
isTiShiCiShu: false,
Box: null,
isloadTomain: true,
isUcMiNiGame: false,
isKuaiShouMiNiGame: false,
isHuaWeiMiNiGame: false,
GuanKaLevelItme: 30,
ksShareBtnHide: null,
isChaPing: 0,
jinbiNum: 0,
jiZhongNum: 0,
isFailNum: 3,
baseSecond: 179,
updataTime: 0,
ShowTuiSongCiShu: 0,
PushuCaiqian: 0,
isTanChuang: 0,
isGameDeBug: true,
is4399MiNiGame: false,
isShowAD180s: false,
SetGoidNum: function (e) {
cc.playerData.coin += e;
cc.global.savePlayerData();
},
setFuLiNum: function (e) {
cc.playerData.cj += e;
cc.global.savePlayerData();
},
GameBtnClose: function (e) {
var o = arguments.length > 1 && undefined !== arguments[1] && arguments[1];
cc.PlatformTools.executeRandVideo();
if (e) {
if (o) {
e.active = false;
} else {
e.removeFromParent();
}
}
},
ShowMfSy: function () {
for (var e = 0; e <= 18; e++) {
if (0 == cc.playerData.Bi_DATA[e]) {
cc.global.LoadPreFtabData("prefab/ui/ui_mianfeiTiYan", function () {}.bind(this));
break;
}
}
},
sceneIDTrue: function () {
console.log("当前值:" + window.GameConfig.SceneID);
if (!window.GameConfig.SceneID) {
return false;
}
console.log("有值");
var e = tt.getLaunchOptionsSync().scene;
if (window.GameConfig.SceneID) {
var o = window.GameConfig.SceneID;
for (var t = 0; t < o.length; t++) {
if (e === o[t]) {
return true;
}
}
}
return false;
},
doInitialize: function () {
GlobData.ANDROIDUtil = this;
},
onAndroidInit: function () {
GlobData.isShowAD180s = window.GameConfig.Time180sAD;
GlobData.isShowAD180s || setTimeout(function () {
GlobData.isShowAD180s = true;
}, 18e4);
},
showRandVideo: function () {
GlobData.GaiLv(window.GameConfig.randomkaiping) && jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "showSplshVideo", "()V");
},
showBanner: function () {
GlobData.isShowAD180s && jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "showBanner", "()V");
},
destroyBanner: function () {
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "CloseBanner", "()V");
},
showInterstitial: function () {
GlobData.isShowAD180s && jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "showInterstitial", "()V");
},
showVideo: function (e, o) {
GlobData.successCallBack = e;
GlobData.failureCallBack = o;
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "playRewardVideo", "()V");
},
VideoSuceess: function () {
if (GlobData.successCallBack) {
GlobData.successCallBack();
GlobData.successCallBack = null;
}
},
VideoFail: function () {
if (GlobData.failureCallBack) {
GlobData.failureCallBack();
GlobData.failureCallBack = null;
}
},
executeYinSiBtn: function () {
jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "jsYinSiButtonClick", "()V");
},
GaiLv: function (e) {
return 1 + Math.floor(100 * Math.random()) <= e;
},
updateSprite: function (e, o) {
var t = e.getComponent(cc.Sprite);
null == t && (t = e.addComponent(cc.Sprite));
var i = cc.loader.getRes(o, cc.SpriteFrame);
if (null != i) {
t.spriteFrame = i;
} else {
cc.loader.loadRes(o, cc.SpriteFrame, function (e, o) {
e || null != t && t.isValid && (t.spriteFrame = o);
});
}
},
yujiazaiSprite: function (e) {
cc.loader.loadRes(e, cc.SpriteFrame, function (e, o) {});
},
ShowAsk: function (e) {
var o = new cc.Node();
var t = o.addComponent(cc.Sprite);
cc.loader.loadRes("showAskkuang", cc.SpriteFrame, function (e, o) {
t.spriteFrame = o;
});
o.parent = cc.director.getScene();
o.zIndex = 9999;
o.setPosition(cc.v2(cc.view.getVisibleSize().width / 2, cc.view.getVisibleSize().height / 2 - 200));
var i = cc.callFunc(function (e) {
e.destroy();
}, o);
var n = cc.sequence(cc.moveTo(.5, cc.view.getVisibleSize().width / 2, cc.view.getVisibleSize().height / 2 + 30).easing(cc.easeIn(.5)), cc.moveTo(.5, cc.view.getVisibleSize().width / 2, cc.view.getVisibleSize().height / 2).easing(cc.easeOut(.5)), i);
o.runAction(n);
var a = new cc.Node();
a.color = new cc.Color(255, 255, 255);
var c = a.addComponent(cc.Label);
var s = cc.js.formatStr("%s", e);
c.string = s;
a.parent = cc.director.getScene();
a.scale = .6;
a.zIndex = 1e4;
a.setPosition(cc.v2(cc.view.getVisibleSize().width / 2, cc.view.getVisibleSize().height / 2 - 200));
i = cc.callFunc(function (e) {
e.destroy();
}, a);
n = cc.sequence(cc.moveTo(.5, cc.view.getVisibleSize().width / 2, cc.view.getVisibleSize().height / 2 + 30).easing(cc.easeIn(.5)), cc.moveTo(.5, cc.view.getVisibleSize().width / 2, cc.view.getVisibleSize().height / 2).easing(cc.easeOut(.5)), i);
a.runAction(n);
}
};
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "79b296b4-d12a-4a36-8f88-dac070599e0a",
"isPlugin": false
}
+156
View File
@@ -0,0 +1,156 @@
cc.Class({
extends: cc.Component,
properties: {},
init: function () {
cc.global = this;
cc.playerData = {};
cc.global.PlayerData = {};
cc.global.level = 1;
cc.global.historyMaxLevel = 1;
cc.global.coin = 0;
cc.global.gameModel = "";
cc.global.levelDate = null;
cc.global.levellist = [];
cc.global.gem = 0;
cc.global.power = 10;
cc.global.powerRecoverTime = 0;
cc.global.soundValueData = {
musicValue: 1,
effectValue: 1
};
cc.global.offenderIndex = 0;
cc.global.levelData = [];
cc.global.lastOnLineTime = 0;
cc.global.signInfo = {
days: 0,
allow: true
};
cc.global.firstGame = true;
cc.global.needGuidance = false;
cc.global.guidance = 0;
cc.global.firstToHome = true;
cc.global.nowChoseBigIndex = -1;
cc.global.nowChoseSmallIndex = -1;
cc.global.gamewin = false;
cc.global.game1_levelOrder = [1, 51, 21, 54, 55, 56, 57, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 50, 18, 19, 20, 53, 52, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49];
cc.global.game2_levelOrder = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70];
this.initPlayerData();
cc.global.levelLimit = [];
},
initPlayerData: function () {
cc.playerData.game1_level = 1;
cc.playerData.game2_level = 1;
cc.playerData.LevelMaxData = 30;
cc.playerData.hande_DATA = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
cc.playerData.handeType = 1;
cc.playerData.coin = 200;
cc.playerData.power = 10;
this.getPlayerData();
},
onTaskUpdate: function (e) {
console.log("更新任务:", e);
cc.global.taskInfo[e].progress.now++;
cc.sys.localStorage.setItem("taskInfo", JSON.stringify(cc.global.taskInfo));
},
onTransitionPosition: function (e, o, t) {
var i = e.convertToWorldSpaceAR(t);
return o.convertToNodeSpaceAR(i);
},
onNumberFormatting: function (e) {
e = e.toString();
return new cc.Numerical(e).getDetails().display;
},
onVibrateShort: function () {
console.log("震动...........");
window.qq && window.qq.vibrateLong({
success: function (e) {}
});
window.tt && window.tt.vibrateLong({
success: function (e) {}
});
window.swan && window.swan.vibrateLong({
success: function (e) {}
});
window.qg && window.qg.vibrateLong({
success: function (e) {}
});
window.wx && window.wx.vibrateLong({
success: function (e) {}
});
},
setCoinNum: function (e) {
cc.playerData.coin += e;
cc.global.savePlayerData();
},
LoadPreFtabData: function (e, o) {
console.log("预制体11111");
cc.loader.loadRes(e, function (t, i) {
if (t) {
console.log("预制体22222" + t);
} else if (i instanceof cc.Prefab) {
var n = "";
var a = e.split("/");
n = a.length <= 0 ? e : a[a.length - 1];
if (cc.director.getScene().getChildByName(n)) {
console.log("预制体22222444444444444");
} else {
var c = cc.instantiate(i);
c.callBack = o;
c.parent = cc.director.getScene();
c.zIndex = 1;
}
} else {
console.log("预制体222223333333333333");
}
});
},
typingAni: function (e, o, t) {
if (this.work) {
this.work = true;
this.unschedule(this.func, this);
} else {
this.work = true;
}
var i = "";
var n = o.split("");
var a = n.length;
var c = 0;
this.func = function () {
i += n[c];
e.string = i;
if (++c == a) {
this.unschedule(this.func, this);
t && t();
this.work = false;
}
}.bind(this);
this.schedule(this.func, .1, cc.macro.REPEAT_FOREVER, 0);
},
timeFormat: function (e) {
e *= 1e3;
Math.floor(e / 1e3 / 60 / 60 / 24);
Math.floor(e / 1e3 / 60 / 60 % 24);
return Math.floor(e / 1e3 / 60 % 60) + ":" + Math.floor(e / 1e3 % 60);
},
randomArray: function (e) {
e.sort(function (e, o) {
if (Math.random() > .5) {
return -1;
} else {
return 1;
}
});
},
savePlayerData: function () {
cc.sys.localStorage.setItem("playerData_hhds", JSON.stringify(cc.playerData));
},
getPlayerData: function (e) {
var o = cc.sys.localStorage.getItem("playerData_hhds");
if (o) {
cc.playerData = JSON.parse(o);
} else {
cc.sys.localStorage.setItem("playerData_hhds", JSON.stringify(cc.playerData));
}
e && e();
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "f3f41c3d-fe11-4794-8726-610d9bb66567",
"isPlugin": false
}
+25
View File
@@ -0,0 +1,25 @@
cc.Class({
extends: cc.Component,
properties: {
showNode: cc.Node
},
start: function () {
cc.global.guochang = this;
},
showZhuanchang: function (e) {
var o = this;
this.node.active = true;
this.showNode.active = true;
this.getComponent(cc.Animation).play();
setTimeout(function () {
if (e) {
e();
e = null;
}
cc.global.Source.onPlayGameEffect("zhuanchang");
}, 450);
setTimeout(function () {
o.showNode.active = false;
}, 1e3);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "eb1fdeeb-216d-4e35-8c82-897b0c16ff44",
"isPlugin": false
}
+7
View File
@@ -0,0 +1,7 @@
cc.Class({
extends: cc.Component,
properties: {},
start: function () {
window.GameConfig.showhand || (this.node.active = false);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "7c27ebd4-e9b3-4551-ac50-83eeb1f9a772",
"isPlugin": false
}
+47
View File
@@ -0,0 +1,47 @@
cc.Class({
extends: cc.Component,
properties: {
label_hintText: {
default: null,
type: cc.Label,
displayName: "提示文本"
}
},
onLoad: function () {},
start: function () {},
init: function () {},
onShowHintText: function (e, o) {
this.funCall = o || null;
this.label_hintText.string = e;
this.node.active = true;
cc.global.Source.onPlayBtnEffect("buttonClick");
},
typingAni: function (e, o, t) {
if (this.work) {
this.work = true;
this.unschedule(this.func, this);
} else {
this.work = true;
}
var i = "";
var n = o.split("");
var a = n.length;
var c = 0;
this.func = function () {
i += n[c];
e.string = i;
if (++c == a) {
this.unschedule(this.func, this);
t && t();
this.work = false;
}
cc.global.Source.onPlayGameEffect("typewriting");
}.bind(this);
this.schedule(this.func, .08, cc.macro.REPEAT_FOREVER, 0);
},
onCloseUI: function () {
this.funCall && this.funCall();
this.node.active = false;
cc.global.Source.onPlayBtnEffect("buttonClick");
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "d50cba79-0dfc-4f60-8b71-d72fb58b4f6b",
"isPlugin": false
}
+36
View File
@@ -0,0 +1,36 @@
cc.Class({
extends: cc.Component,
properties: {
img: {
default: null,
type: cc.SpriteFrame,
displayName: "更换的图片"
},
startTime: {
default: 0,
displayName: "起始延迟时间"
},
returnDelayTime: {
default: -1,
displayName: "返回延迟的时间,负数为不返回"
},
eventNode_over: {
default: null,
type: cc.Node,
displayName: "结束事件节点"
}
},
start: function () {
this.node.switchEvent = this.switchEvent.bind(this);
},
switchEvent: function () {
var e = this;
var o = this.node.getComponent(cc.Sprite);
cc.tween(o).delay(this.startTime).call(function () {
o.spriteFrame = e.img;
e.eventNode_over && e.eventNode_over.switchEvent();
}).start();
},
returnStartPos: function () {},
restoreEvent: function () {}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "7af10c43-d1b2-4f12-b36a-b7a3e166fc0e",
"isPlugin": false
}
+20
View File
@@ -0,0 +1,20 @@
cc.Class({
extends: cc.Component,
properties: {},
start: function () {
var e = this;
setTimeout(function () {
e.jiance();
}, 2e3);
},
jiance: function () {
var e = cc.sys.localStorage.getItem("user");
if (undefined == e || null == e || 0 == e.length) {
console.log("新用户");
cc.director.loadScene("UserScence");
} else {
console.log("老用户");
cc.director.loadScene("GameLoad");
}
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "c91b7215-0306-426a-8922-31517be69ed8",
"isPlugin": false
}
+198
View File
@@ -0,0 +1,198 @@
function i(e, o) {
if (!(e instanceof o)) {
throw new TypeError("Cannot call a class as a function");
}
}
function n(e, o) {
for (var t = 0; t < o.length; t++) {
var i = o[t];
i.enumerable = i.enumerable || false;
i.configurable = true;
"value" in i && (i.writable = true);
Object.defineProperty(e, i.key, i);
}
}
function a(e, o, t) {
o && n(e.prototype, o);
t && n(e, t);
return e;
}
var c = function () {
function e() {
i(this, e);
this.video = null;
this.mediaRecorder = null;
this.appID = "ks661466196836111912";
this.chapingPos = "2300002040_02";
this.spVideo = "2300002040_01";
}
a(e, [{
key: "doInitialize",
value: function () {
console.log("快手初始化!!!!");
kwaigame.init({
appId: this.appID
});
this.createRecorder();
if (this.GaiLv(window.GameConfig.randomkaiping)) {
console.log("快手开屏====");
this.executeShowAwardVideo(null, null);
}
}
}, {
key: "GaiLv",
value: function (e) {
return 1 + Math.floor(100 * Math.random()) <= e;
}
}, {
key: "executeShowAwardVideo",
value: function (e, o) {
var t = this;
this.successCallBack = e;
this.failureCallBack = o;
var i = {};
i.adUnitId = this.spVideo;
var n = kwaigame.createRewardedVideoAd(i);
if (n) {
console.log("激励广告组件获取成功");
n.show({
success: function () {
console.log("激励视频播放成功");
},
fail: function (e) {
t.executeFailureHandle();
console.log("激励视频播放失败: " + JSON.stringify(e));
}
});
n.onClose(function (e) {
console.log("激励视频关闭回调: " + JSON.stringify(e));
t.executeFailureHandle();
});
n.onReward(function (e) {
console.log("激励视频奖励回调: " + JSON.stringify(e));
t.executeSuccessHandle();
});
} else {
this.executeFailureHandle();
console.log("激励广告组件获取失败");
}
}
}, {
key: "executeSuccessHandle",
value: function () {
cc.audioEngine.resumeAll();
cc.director.resume();
this.successCallBack && this.successCallBack();
this.successCallBack = null;
}
}, {
key: "executeFailureHandle",
value: function () {
cc.audioEngine.resumeAll();
cc.director.resume();
this.failureCallBack && this.failureCallBack();
this.failureCallBack = null;
}
}, {
key: "createRecorder",
value: function () {
this.mediaRecorder = kwaigame.createMediaRecorder();
if (null !== this.mediaRecorder) {
var e = this;
this.mediaRecorder.onStart(function () {
console.log("录频开始成功");
});
this.mediaRecorder.onStop(function (o) {
if (o && o.videoID) {
e.video = o.videoID;
window.KSshareCall(2);
console.log("录屏停止,录制成功");
} else {
window.KSshareCall(1);
console.log("录屏停止,录制失败");
}
});
this.mediaRecorder.onError(function (e) {
console.log("录频过程中发生错误 ".concat(JSON.stringify(e), " "));
});
} else {
console.log("当前 APP 版本不支持录屏");
}
}
}, {
key: "executeRecorder",
value: function () {
console.log("录屏开始========");
this.mediaRecorder && this.mediaRecorder.start();
}
}, {
key: "stopRecorder",
value: function () {
console.log("录屏结束========");
this.mediaRecorder && this.mediaRecorder.stop();
}
}, {
key: "executeShareRecorder",
value: function () {
console.log("录屏分享========");
if (this.mediaRecorder) {
if (null === this.video) {
return;
}
this.mediaRecorder.publishVideo({
video: this.video,
callback: function (e) {
if (e) {
console.log("发布录屏失败: ".concat(JSON.stringify(e)));
} else {
window.KSshareCall(1);
console.log("发布录屏成功");
}
}
});
}
}
}, {
key: "executeShowBanner1",
value: function () {
this.executeJieSuanChaPing();
}
}, {
key: "executeJieSuanChaPing",
value: function () {
console.log("快手插屏");
var e = ks.createInterstitialAd({
adUnitId: this.chapingPos
});
e.show().then(function () {
return console.log("插屏\xA0广告显示");
});
e.onClose(function (e) {});
e.onError(function (e) {
console.log(e);
});
}
}, {
key: "Suijivideo",
value: function () {
this.GaiLv(GameConfig.randomShowvideo) && this.executeShowAwardVideo(null, null);
}
}, {
key: "executeHideBanner",
value: function () {}
}, {
key: "executeShowPushBox",
value: function () {}
}, {
key: "isInstalledShortcut",
value: function () {}
}, {
key: "sendDesktopShortcut",
value: function (e) {}
}, {
key: "executeBlockAdShow",
value: function (e, o) {}
}]);
return e;
}();
module.exports = c;
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "167db121-0666-44b5-854d-4e335c64c7d4",
"isPlugin": false
}
+51
View File
@@ -0,0 +1,51 @@
cc.Class({
extends: cc.Component,
properties: {
_parentScript: null,
levelLabel: {
default: null,
type: cc.Label,
displayName: "关卡序号"
},
notUnlockKuang: {
default: null,
type: cc.Node,
displayName: "未解锁框"
},
nowLevelNode: {
default: null,
type: cc.Node,
displayName: "当前关卡节点"
},
unlockLevelBj: {
default: null,
type: cc.Node,
displayName: "解锁"
}
},
start: function () {},
onRegister: function (e) {
this._parentScript = e;
},
init: function (e, o, t) {
this.index = o;
this.levelLabel.string = o + 1;
this.isLock = true;
this.notUnlockKuang.active = false;
this.nowLevelNode.active = false;
this.unlockLevelBj.active = false;
o < t && (this.isLock = false);
if (o + 1 == t) {
this.nowLevelNode.active = true;
this.unlockLevelBj.active = true;
} else if (o + 1 < t) {
this.unlockLevelBj.active = true;
} else {
this.notUnlockKuang.active = true;
this.isLock = true;
}
},
onButtonEvevt: function () {
this._parentScript.onCheckeLevel(this.index);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "79a550e0-9fb3-4e9a-9ee4-07aa13ec72fc",
"isPlugin": false
}
+139
View File
@@ -0,0 +1,139 @@
cc.Class({
extends: cc.Component,
properties: {
_homeManage: null,
scrollViewContent: cc.Node,
itemScroll: cc.ScrollView,
pagesItemsNum: {
default: 2,
displayName: "每页个数"
},
leftButtonNode: {
default: null,
type: cc.Node,
displayName: "上一页"
},
rightButtonNode: {
default: null,
type: cc.Node,
displayName: "下一页"
},
pagesNumLabel: {
default: null,
type: cc.Label,
displayName: "页数"
}
},
onLoad: function () {
this.pagesNum = 1;
this.canclick = false;
},
start: function () {
this.onShowWindow();
},
initdata: function (e, o) {
console.log("leveldata:" + e);
this.leveldata = e;
this.levellist = o;
},
init: function () {
this.pagesItemsNum || (this.pagesItemsNum = 12);
this.pagesNum = 1;
},
onShowWindow: function () {
var e = this;
this.pagesNum = 1;
this.onRefreshLevleWindow();
0 == this.node.active && (this.node.active = true);
window.tt || cc.PlatformTools.executeShowBanner();
cc.PlatformTools.executeShowInterstitial();
setTimeout(function () {
var o = e.leveldata / 3 * 191 - 400;
e.itemScroll.scrollToOffset(cc.v2(0, o), .5);
}, 0);
},
onRefreshLevleWindow: function () {
var e = [];
for (var o = 0; o < this.levellist.length; o++) {
e.push(o);
}
this.onRefreshLevleList(e);
},
onRefreshLevleList: function (e) {
var o = this.scrollViewContent.children;
if (o.length >= e.length) {
for (var t = 0; t < o.length; t++) {
if (t < e.length) {
o[t].active = true;
} else {
o[t].active = false;
}
}
}
for (var i = 0; i < e.length; i++) {
if (i < o.length) {
o[i].getComponent("LevelItemScript").onRegister(this);
o[i].getComponent("LevelItemScript").init(e[i], i + this.pagesItemsNum * (this.pagesNum - 1), this.leveldata);
} else {
var n = cc.instantiate(o[0]);
n.getComponent("LevelItemScript").onRegister(this);
n.getComponent("LevelItemScript").init(e[i], i + this.pagesItemsNum * (this.pagesNum - 1), this.leveldata);
this.scrollViewContent.addChild(n);
}
}
},
onCheckeLevel: function (e) {
cc.global.Source.onPlayBtnEffect("buttonClick");
console.log("onCheckeLevel=", e);
if (e >= this.leveldata) {
GlobData.ShowAsk("当前关卡尚未解锁");
} else {
var o = this;
if (1 == cc.global.easterEggModel) {
e = cc.global.easterEggLevels[e];
} else {
e += 1;
}
if (!o.canclick) {
o.canclick = true;
cc.global.level = e;
if (cc.playerData.coin >= 100) {
cc.playerData.coin -= 100, cc.global.savePlayerData(), GlobData.ShowAsk("金币-100"), setTimeout(function () {
cc.global.zhiyinNode && cc.global.zhiyinNode.showZhuanchang(function () {
cc.director.loadScene("GameScense");
});
}, 800);
} else {
cc.global.MianScript.showTuiSong(function () {
console.log("观看完视频了。");
cc.global.zhiyinNode && cc.global.zhiyinNode.showZhuanchang(function () {
cc.director.loadScene("GameScense");
});
}, function () {
o.canclick = false;
});
}
}
}
},
onButtonClick: function (e) {
cc.global.Source.onPlayBtnEffect("buttonClick");
switch (e.target.name) {
case "leftButtonNode":
this.pagesNum--;
this.pagesNumLabel.string = this.pagesNum;
this.onRefreshLevleWindow();
break;
case "rightButtonNode":
this.pagesNum++;
this.pagesNumLabel.string = this.pagesNum;
this.onRefreshLevleWindow();
break;
case "CloseBtn":
cc.director.loadScene("GameMain");
break;
default:
console.log("点击了其他按钮:", e);
}
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "fecb3130-c6dd-4bbc-b203-48d17e0a8e3d",
"isPlugin": false
}
+9
View File
@@ -0,0 +1,9 @@
cc.Class({
extends: cc.Component,
properties: {
leveltex: cc.Label
},
start: function () {
this.leveltex.string = "" + cc.global.level;
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "69f1a81b-93ea-4c96-bd1b-1af1a6fd56f4",
"isPlugin": false
}
+371
View File
@@ -0,0 +1,371 @@
window.MZys = {
createChaping: function (e, o, t) {
console.log("createchaping ");
var i = cc.view.getVisibleSize();
cc.v2(i.width / 2, i.height / 2);
var n = new cc.Node();
n.parent = cc.director.getScene();
n.zIndex = 9999;
n.setContentSize(cc.winSize);
var a = new cc.Texture2D();
var c = new cc.SpriteFrame();
a.initWithData(new Uint8Array([0, 0, 0]), cc.Texture2D.PixelFormat.RGB888, 1, 1, cc.winSize);
c.setTexture(a);
c.setRect(cc.rect(0, 0, 20 * cc.winSize.width, 20 * cc.winSize.width));
var s = new cc.Node();
s.parent = n;
s.opacity = 1;
s.addComponent(cc.Sprite).spriteFrame = c;
s.on("touchend", function (e) {});
var l = new cc.Node();
l.parent = n;
l.x = .5 * i.width;
l.y = .5 * i.height;
var r = l.addComponent(cc.Sprite);
a = new cc.Texture2D();
c = new cc.SpriteFrame();
a.initWithData(new Uint8Array([0, 0, 0]), cc.Texture2D.PixelFormat.RGB888, 1, 1, cc.winSize);
c.setTexture(a);
c.setRect(cc.rect(0, 0, 630, 475));
r.spriteFrame = c;
r.sizeMode = cc.Sprite.SizeMode.Custom;
cc.loader.load(e, function (o, t) {
r.spriteFrame = new cc.SpriteFrame(e);
});
var d = new cc.Node();
d.parent = n;
d.x = .5 * i.width;
d.y = .5 * i.height;
d.addComponent(cc.Sprite);
d.on(cc.Node.EventType.TOUCH_END, function (e) {
console.log("ad click");
t && t();
n.removeFromParent();
});
l.on(cc.Node.EventType.TOUCH_END, function (e) {
console.log("ad click");
t && t();
n.removeFromParent();
});
var u = new cc.Node();
u.parent = n;
u.x = i.width / 2 + 280;
u.y = .75 * i.height;
u.sizeMode = cc.Sprite.SizeMode.Custom;
cc.loader.loadRes("ysguanggao/native_3", function (e, o) {
u.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(o);
});
var h = new cc.Node();
h.parent = n;
h.x = i.width / 2 + 270;
h.y = .3 * i.height;
cc.loader.loadRes("ysguanggao/native_1", function (e, o) {
h.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(o);
});
var f = new cc.Node();
f.parent = n;
f.x = i.width / 2 + 260;
f.y = .21 * i.height;
cc.loader.loadRes("ysguanggao/native_7", function (e, o) {
f.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(o);
});
f.on(cc.Node.EventType.TOUCH_END, function (e) {
console.log("ad click");
t && t();
n.removeFromParent();
});
var g = new cc.Node();
g.parent = n;
g.opacity = 1;
g.x = i.width / 2 + 280;
g.y = .75 * i.height;
g.scale = window.ServerConfigBd.closeBtnScale;
cc.loader.loadRes("ysguanggao/native_3", function (e, o) {
g.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(o);
});
g.on(cc.Node.EventType.TOUCH_END, function (e) {
console.log("closeBtn click");
o && o();
n.removeFromParent();
});
return n;
},
createBanner: function (e, o, t) {
var i = cc.view.getVisibleSize();
cc.v2(i.width / 2, i.height / 2);
var n = new cc.Node();
n.parent = cc.director.getScene();
n.zIndex = 9999;
n.setContentSize(cc.winSize);
var a = new cc.Node();
a.parent = n;
a.x = .5 * i.width;
a.y = .05 * i.height;
var c = a.addComponent(cc.Sprite);
var s = new cc.Texture2D();
var l = new cc.SpriteFrame();
s.initWithData(new Uint8Array([0, 0, 0]), cc.Texture2D.PixelFormat.RGB888, 1, 1, cc.winSize);
l.setTexture(s);
l.setRect(cc.rect(0, 0, .5 * cc.winSize.width, .14 * cc.winSize.height));
c.spriteFrame = l;
c.sizeMode = cc.Sprite.SizeMode.CUSTOM;
cc.loader.load(e, function (e, o) {
c.spriteFrame = new cc.SpriteFrame(o);
});
a.on(cc.Node.EventType.TOUCH_END, function (e) {
console.log("ad click");
t && t();
n.removeFromParent();
});
var r = new cc.Node();
r.parent = n;
r.x = .74 * i.width;
r.y = .09 * i.height;
cc.loader.loadRes("ysguanggao/native_3", function (e, o) {
r.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(o);
});
var d = new cc.Node();
d.parent = n;
d.x = .74 * i.width;
d.y = .02 * i.height;
cc.loader.loadRes("ysguanggao/native_1", function (e, o) {
d.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(o);
});
r.on(cc.Node.EventType.TOUCH_END, function (e) {
console.log("closeBtn click");
o && o();
n.removeFromParent();
});
return n;
}
};
window.MeiZuUtil = {
shipinID: "viArHNtb",
chapingID: "8T8j2Hy9",
bannerID: "yxkS3shy",
yuanshengID1: "os67rRSZ",
yuanshengID2: "",
yuanshengID3: "",
rewardedVideoAd: null,
AdSuccess: function () {
if (null != MeiZuUtil.videoCallback) {
MeiZuUtil.videoCallback();
MeiZuUtil.videoCallback = null;
}
},
Adfail: function () {
if (null != MeiZuUtil.videofailCallback) {
MeiZuUtil.videofailCallback();
MeiZuUtil.videofailCallback = null;
}
},
yuanshengIndex: 0,
yuanshengADK: null,
isVideo: true,
videoInstance: null,
isFrist: true,
isShowChaping: 0,
portalInstance: null,
bannerNative: null,
chapingnativeAd: null,
lfenzhong: false,
isReward: false,
wincount: 0,
SHOWIndex: 0,
initQQShow: function () {
MeiZuUtil.lfenzhong = true;
MeiZuUtil.GaiLv(window.ServerConfigBd.randomkaiping) && MeiZuUtil.getVideoAd(null, null);
},
getVideoAd: function (e, o) {
MeiZuUtil.isReward = false;
this.videoCallback = e;
this.videofailCallback = o;
MeiZuUtil.rewardedVideoAd = qg.createRewardedVideoAd({
adUnitId: MeiZuUtil.shipinID
});
MeiZuUtil.rewardedVideoAd.load();
MeiZuUtil.rewardedVideoAd.onLoad(function () {
console.log("激励视频加载成功");
MeiZuUtil.rewardedVideoAd.show();
});
MeiZuUtil.rewardedVideoAd.onRewarded(function () {
MeiZuUtil.isReward = true;
});
MeiZuUtil.rewardedVideoAd.onClose(function (e) {
console.log("res11111:" + MeiZuUtil.isReward);
if (MeiZuUtil.isReward) {
MeiZuUtil.AdSuccess();
} else {
MeiZuUtil.Adfail();
}
});
MeiZuUtil.rewardedVideoAd.onError(function (e) {
MeiZuUtil.Adfail();
console.log("激励视频::" + e);
});
},
GaiLv: function (e) {
return 1 + Math.floor(100 * Math.random()) <= e;
},
showAd_Banner: function () {
MeiZuUtil.clearAD();
MeiZuUtil.showBanner();
},
randomVideo: function () {
MeiZuUtil.GaiLv(window.ServerConfigBd.randomShowvideo) && MeiZuUtil.getVideoAd(null, null);
},
showAdInGame: function () {
MeiZuUtil.clearAD();
MeiZuUtil.showBanner();
},
showAd_ChaPing: function () {
MeiZuUtil.createNativeadChaping();
},
winVideo: function () {
MeiZuUtil.wincount++;
0 !== window.ServerConfigBd.winVideo && MeiZuUtil.wincount % window.ServerConfigBd.winVideo == 0 && MeiZuUtil.getVideoAd(null, null);
},
showBanner: function () {
if (null != MeiZuUtil.bannerAd) {
MeiZuUtil.bannerAd.offResize();
MeiZuUtil.bannerAd.offError();
MeiZuUtil.bannerAd.hide();
MeiZuUtil.bannerAd = null;
}
MeiZuUtil.bannerAd = qg.createBannerAd({
adUnitId: MeiZuUtil.bannerID,
style: {
left: (qg.getSystemInfoSync().screenWidth - .4 * qg.getSystemInfoSync().screenWidth) / 2,
top: qg.getSystemInfoSync().screenHeight - 100,
width: .4 * qg.getSystemInfoSync().screenWidth,
height: .4 * qg.getSystemInfoSync().screenWidth * .24
}
});
MeiZuUtil.bannerAd.onError(function (e) {
console.log("banner sdk bannerAd错误日志" + e.errMsg + e.errCode);
});
MeiZuUtil.bannerAd.onResize(function (e) {
console.log("banner onResize:" + e.width, e.height);
console.log("banner onResize:" + (qg.getSystemInfoSync().screenWidth - .4 * qg.getSystemInfoSync().screenWidth) / 2);
MeiZuUtil.bannerAd.style.top = qg.getSystemInfoSync().screenHeight - e.height;
MeiZuUtil.bannerAd.style.left = (qg.getSystemInfoSync().screenWidth - .4 * qg.getSystemInfoSync().screenWidth) / 2;
MeiZuUtil.bannerAd.show();
});
},
closeBanner: function () {
MeiZuUtil.clearAD();
},
showChaping: function () {
MeiZuUtil.clearAD();
var e = qg.createInsertAd({
adUnitId: MeiZuUtil.chapingID
});
e.onLoad(function () {
console.log("insert 广告加载成功");
e.show();
});
e.onError(function (e) {
console.log(e);
});
e.load();
},
clearAD: function () {
MeiZuUtil.bannerAd && MeiZuUtil.bannerAd.hide();
MeiZuUtil.yuanshengADK && MeiZuUtil.yuanshengADK.destroy();
},
createNativeadChaping: function () {
if (MeiZuUtil.chapingnativeAd) {
MeiZuUtil.chapingnativeAd.offLoad();
MeiZuUtil.chapingnativeAd.offError();
MeiZuUtil.chapingnativeAd = null;
}
var e = [MeiZuUtil.yuanshengID1];
MeiZuUtil.yuanshengIndex += 1;
MeiZuUtil.yuanshengIndex >= e.length && (MeiZuUtil.yuanshengIndex = 0);
MeiZuUtil.chapingnativeAd = qg.createNativeAd({
adUnitId: e[MeiZuUtil.yuanshengIndex]
});
MeiZuUtil.chapingnativeAd.onLoad(function (e) {
MeiZuUtil.chapingnativeAd.offLoad();
MeiZuUtil.chapingnativeAd.reportAdShow({
adId: e.adList[0].adId
});
MeiZuUtil.clearAD();
MeiZuUtil.yuanshengADK = MZys.createChaping(e.adList[0].imgUrlList[0], function () {
MeiZuUtil.chapingnativeAd.offLoad();
MeiZuUtil.chapingnativeAd.offError();
MeiZuUtil.yuanshengADK = null;
}, function () {
MeiZuUtil.chapingnativeAd.reportAdClick({
adId: e.adList[0].adId
});
MeiZuUtil.chapingnativeAd.offLoad();
MeiZuUtil.chapingnativeAd.offError();
MeiZuUtil.yuanshengADK = null;
});
});
MeiZuUtil.chapingnativeAd.onError(function (e) {
MeiZuUtil.chapingnativeAd.offLoad();
MeiZuUtil.chapingnativeAd.offError();
MeiZuUtil.chapingnativeAd = null;
console.log("插屏显示错误了----" + JSON.stringify(e));
MeiZuUtil.showChaping();
});
MeiZuUtil.chapingnativeAd.load();
},
createNativeadBanner: function () {
if (MeiZuUtil.bannerNative) {
MeiZuUtil.bannerNative.offLoad();
MeiZuUtil.bannerNative.offError();
MeiZuUtil.bannerNative = null;
}
MeiZuUtil.clearAD();
var e = [MeiZuUtil.yuanshengID1];
MeiZuUtil.yuanshengIndex += 1;
MeiZuUtil.yuanshengIndex >= e.length && (MeiZuUtil.yuanshengIndex = 0);
MeiZuUtil.bannerNative = qg.createNativeAd({
adUnitId: e[MeiZuUtil.yuanshengIndex]
});
MeiZuUtil.bannerNative.onLoad(function (e) {
MeiZuUtil.bannerNative.reportAdShow({
adId: e.adList[0].adId
});
MeiZuUtil.clearAD();
MeiZuUtil.yuanshengADK = MZys.createBanner(e.adList[0].imgUrlList[0], function () {
MeiZuUtil.bannerNative.offLoad();
MeiZuUtil.bannerNative.offError();
MeiZuUtil.yuanshengADK = null;
}, function () {
MeiZuUtil.bannerNative.reportAdClick({
adId: e.adList[0].adId
});
MeiZuUtil.bannerNative.offLoad();
MeiZuUtil.bannerNative.offError();
MeiZuUtil.yuanshengADK = null;
});
});
MeiZuUtil.bannerNative.onError(function (e) {
MeiZuUtil.bannerNative.offLoad();
MeiZuUtil.bannerNative.offError();
console.log("调用banner错误了===" + JSON.stringify(e));
MeiZuUtil.GaiLv(window.ServerConfigBd.quitShow) && MeiZuUtil.showBanner();
});
MeiZuUtil.bannerNative.load();
},
createNativead: function () {
var e = [MeiZuUtil.yuanshengID1];
MeiZuUtil.yuanshengIndex += 1;
MeiZuUtil.yuanshengIndex >= e.length && (MeiZuUtil.yuanshengIndex = 0);
var o = qg.createNativeAd({
adUnitId: e[MeiZuUtil.yuanshengIndex]
});
o.onLoad(function (e) {
o.offLoad();
o.reportAdShow({
adId: e.adList[0].adId
});
});
o.onError(function (e) {});
o.load();
}
};
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "6a0170c0-794a-4198-80d5-e3ab5ec8d456",
"isPlugin": false
}
+103
View File
@@ -0,0 +1,103 @@
cc.Class({
extends: cc.Component,
properties: {
rightItem: cc.Node,
otherItems: {
type: cc.Node,
default: []
},
targetScale: {
displayName: "点击后放大到多少",
default: .65
},
cankaoItem: {
type: cc.Node,
displayName: "要移动到的位置",
default: null
},
eventNode_over: {
default: null,
type: cc.Node,
displayName: "移动完成事件节点"
},
isshow: {
default: true,
displayName: "移动到指定位置后的状态"
}
},
onLoad: function () {
if (this.rightItem) {
this.rightItem.on(cc.Node.EventType.TOUCH_START, this.onMoveStart, this);
this.rightItem.on(cc.Node.EventType.TOUCH_MOVE, this.onMove, this);
this.rightItem.on(cc.Node.EventType.TOUCH_END, this.onMoveEnd, this);
this.originPos = this.rightItem.getPosition();
this.originScale = this.rightItem.scale;
}
this.originPos1 = [];
for (var e = 0; e < this.otherItems.length; e++) {
this.otherItems[e].on(cc.Node.EventType.TOUCH_START, this.onMoveStart.bind(this));
this.otherItems[e].on(cc.Node.EventType.TOUCH_MOVE, this.onMove.bind(this));
this.otherItems[e].on(cc.Node.EventType.TOUCH_END, this.onMoveEndBack.bind(this));
this.otherItems[e].index = e;
this.originPos1.push(this.otherItems[e].getPosition());
}
},
start: function () {},
onMoveStart: function (e) {
e.target.scale = this.targetScale;
e.target.moveStartX = e.target.x;
e.target.moveStartY = e.target.y;
this.node.parent.getChildByName("hand_zhiyin") && 1 == this.node.parent.getChildByName("hand_zhiyin").active && (this.node.parent.getChildByName("hand_zhiyin").active = false);
},
onMove: function (e) {
var o = e.getStartLocation();
var t = e.getLocation();
e.target.x = e.target.moveStartX + t.x - o.x;
e.target.y = e.target.moveStartY + t.y - o.y;
},
onMoveEndBack: function (e) {
var o = e.target.index;
this.otherItems[o].x = this.originPos1[o].x;
this.otherItems[o].y = this.originPos1[o].y;
cc.global._gameManage.onChaHao();
},
onMoveEnd: function (e) {
e.target.x;
e.target.y;
if (this.cankaoItem) {
var o = cc.global.onTransitionPosition(this.rightItem.parent, this.cankaoItem.parent, e.target.getPosition());
if (this.cankaoItem.getBoundingBox().contains(o)) {
if (this.node.parent.getComponent("levelCount")) {
this.node.parent.getComponent("levelCount").finshiNmu.push(this.node.name);
console.log("进这里了");
}
this.onRight();
if (!this.isshow) {
return void (this.rightItem.active = this.isshow);
}
this.rightItem.parent = this.cankaoItem;
this.rightItem.setPosition(0, 0);
} else {
if (this.node.parent.getComponent("levelCount")) {
for (var t = 0; t < this.node.parent.getComponent("levelCount").finshiNmu.length; t++) {
-1 != this.node.name.indexOf(this.node.parent.getComponent("levelCount").finshiNmu[t]) && this.node.parent.getComponent("levelCount").finshiNmu.pop(this.node.name);
}
}
e.target.scale = this.originScale;
cc.global._gameManage.onChaHao();
e.target.setPosition(this.originPos.x, this.originPos.y);
}
} else {
cc.global._gameManage.onChaHao();
e.target.scale = this.originScale;
this.rightItem.setPosition(this.originPos.x, this.originPos.y);
}
},
onRight: function (e) {
cc.global.levelCount.jiance();
this.eventNode_over && this.eventNode_over.switchEvent();
this.rightItem.off(cc.Node.EventType.TOUCH_START, this.onMoveStart, this);
this.rightItem.off(cc.Node.EventType.TOUCH_END, this.onMoveEnd, this);
this.rightItem.off(cc.Node.EventType.TOUCH_MOVE, this.onMove, this);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "e9c683af-8147-455b-9bb7-ae65cd08f232",
"isPlugin": false
}
+110
View File
@@ -0,0 +1,110 @@
cc.Class({
extends: cc.Component,
properties: {
rightItem: cc.Node,
otherItems: {
type: cc.Node,
default: []
},
startTime: {
default: 0,
displayName: "起始延迟时间"
},
targetScale: {
displayName: "点击后放大到多少",
default: .65
},
cankaoItem: {
type: cc.Node,
displayName: "要移动到的位置",
default: null
},
eventNode_over: {
default: null,
type: cc.Node,
displayName: "移动完成事件节点"
},
eventNode_over2: {
default: null,
type: cc.Node,
displayName: "移动完成的清况2"
},
isshow: {
default: true,
displayName: "移动到指定位置后的状态"
}
},
onLoad: function () {
if (this.rightItem) {
this.rightItem.on(cc.Node.EventType.TOUCH_START, this.onMoveStart, this);
this.rightItem.on(cc.Node.EventType.TOUCH_MOVE, this.onMove, this);
this.rightItem.on(cc.Node.EventType.TOUCH_END, this.onMoveEnd, this);
}
this.originPos = this.rightItem.getPosition();
this.originScale = this.rightItem.scale;
},
start: function () {},
onMoveStart: function (e) {
e.target.scale = this.targetScale;
e.target.moveStartX = e.target.x;
e.target.moveStartY = e.target.y;
this.node.parent.getChildByName("hand_zhiyin") && 1 == this.node.parent.getChildByName("hand_zhiyin").active && (this.node.parent.getChildByName("hand_zhiyin").active = false);
},
onMove: function (e) {
var o = e.getStartLocation();
var t = e.getLocation();
e.target.x = e.target.moveStartX + t.x - o.x;
e.target.y = e.target.moveStartY + t.y - o.y;
},
onMoveEndBack: function (e) {
var o = e.target.index;
this.otherItems[o].x = this.originPos[o].x;
this.otherItems[o].y = this.originPos[o].y;
},
onMoveEnd: function (e) {
e.target.x;
e.target.y;
if (this.cankaoItem && this.node.canTesting && 1 == this.cankaoItem.active) {
var o = cc.global.onTransitionPosition(this.rightItem.parent, this.cankaoItem.parent, e.target.getPosition());
if (this.cankaoItem.getBoundingBox().contains(o)) {
if (cc.global.levelCountOrder) {
cc.global.levelCountOrder.finshiNmu.push(this.node.name);
console.log("进这里了");
}
this.onRight();
if (!this.isshow) {
return void (this.rightItem.active = this.isshow);
}
this.rightItem.parent = this.cankaoItem;
this.rightItem.setPosition(0, 0);
} else {
if (cc.global.levelCountOrder) {
for (var t = 0; t < cc.global.levelCountOrder.finshiNmu.length; t++) {
-1 != this.node.name.indexOf(cc.global.levelCountOrder.finshiNmu[t]) && cc.global.levelCountOrder.finshiNmu.pop(this.node.name);
}
}
e.target.scale = this.originScale;
cc.global._gameManage.onChaHao();
e.target.setPosition(this.originPos.x, this.originPos.y);
}
} else {
cc.global._gameManage.onChaHao();
e.target.scale = this.originScale;
this.rightItem.setPosition(this.originPos.x, this.originPos.y);
}
},
onRight: function (e) {
setTimeout(function () {
cc.global.levelCountOrder.chengaOrder();
cc.global.levelCountOrder.jiance();
}, this.startTime);
if (cc.global.levelCountOrder.finshiNmu.length == cc.global.levelCountOrder.morenNode.length && this.eventNode_over2) {
this.eventNode_over2.switchEvent();
} else {
this.eventNode_over && this.eventNode_over.switchEvent();
}
this.rightItem.off(cc.Node.EventType.TOUCH_START, this.onMoveStart, this);
this.rightItem.off(cc.Node.EventType.TOUCH_END, this.onMoveEnd, this);
this.rightItem.off(cc.Node.EventType.TOUCH_MOVE, this.onMove, this);
}
});
@@ -0,0 +1,4 @@
{
"uuid": "904ad0cf-0038-4718-9e00-1e93abbf531e",
"isPlugin": false
}
+103
View File
@@ -0,0 +1,103 @@
cc.Class({
extends: cc.Component,
properties: {
rightItem: cc.Node,
otherItems: {
type: cc.Node,
default: []
},
targetScale: {
displayName: "点击后放大到多少",
default: .65
},
cankaoItem: {
type: cc.Node,
displayName: "要移动到的位置",
default: null
},
eventNode_over: {
default: null,
type: cc.Node,
displayName: "移动完成事件节点"
},
eventNode_over2: {
default: null,
type: cc.Node,
displayName: "移动完成事件节点情况2"
},
isshow: {
default: true,
displayName: "移动到指定位置后的状态"
}
},
onLoad: function () {
if (this.rightItem) {
this.rightItem.on(cc.Node.EventType.TOUCH_START, this.onMoveStart, this);
this.rightItem.on(cc.Node.EventType.TOUCH_MOVE, this.onMove, this);
this.rightItem.on(cc.Node.EventType.TOUCH_END, this.onMoveEnd, this);
}
this.originPos = this.rightItem.getPosition();
this.originScale = this.rightItem.scale;
},
start: function () {},
onMoveStart: function (e) {
e.target.scale = this.targetScale;
e.target.moveStartX = e.target.x;
e.target.moveStartY = e.target.y;
this.node.parent.getChildByName("hand_zhiyin") && 1 == this.node.parent.getChildByName("hand_zhiyin").active && (this.node.parent.getChildByName("hand_zhiyin").active = false);
},
onMove: function (e) {
var o = e.getStartLocation();
var t = e.getLocation();
e.target.x = e.target.moveStartX + t.x - o.x;
e.target.y = e.target.moveStartY + t.y - o.y;
},
onMoveEndBack: function (e) {
var o = e.target.index;
this.otherItems[o].x = this.originPos[o].x;
this.otherItems[o].y = this.originPos[o].y;
},
onMoveEnd: function (e) {
e.target.x;
e.target.y;
if (this.cankaoItem) {
var o = cc.global.onTransitionPosition(this.rightItem.parent, this.cankaoItem.parent, e.target.getPosition());
if (this.cankaoItem.getBoundingBox().contains(o)) {
if (this.node.parent.getComponent("levelCount")) {
this.node.parent.getComponent("levelCount").finshiNmu.push(this.node.name);
console.log("进这里了");
}
this.onRight();
if (!this.isshow) {
return void (this.rightItem.active = this.isshow);
}
this.rightItem.parent = this.cankaoItem;
this.rightItem.setPosition(0, 0);
} else {
if (this.node.parent.getComponent("levelCount")) {
for (var t = 0; t < this.node.parent.getComponent("levelCount").finshiNmu.length; t++) {
-1 != this.node.name.indexOf(this.node.parent.getComponent("levelCount").finshiNmu[t]) && this.node.parent.getComponent("levelCount").finshiNmu.pop(this.node.name);
}
}
e.target.scale = this.originScale;
cc.global._gameManage.onChaHao();
e.target.setPosition(this.originPos.x, this.originPos.y);
}
} else {
cc.global._gameManage.onChaHao();
e.target.scale = this.originScale;
this.rightItem.setPosition(this.originPos.x, this.originPos.y);
}
},
onRight: function (e) {
if (1 == cc.global.levelCount.finshiNmu.length) {
this.eventNode_over && this.eventNode_over.switchEvent();
} else {
this.eventNode_over2 && this.eventNode_over2.switchEvent();
}
cc.global.levelCount.jiance();
this.rightItem.off(cc.Node.EventType.TOUCH_START, this.onMoveStart, this);
this.rightItem.off(cc.Node.EventType.TOUCH_END, this.onMoveEnd, this);
this.rightItem.off(cc.Node.EventType.TOUCH_MOVE, this.onMove, this);
}
});
@@ -0,0 +1,4 @@
{
"uuid": "87cd6708-eac9-45db-a921-b3ae99ba3fb3",
"isPlugin": false
}
+351
View File
@@ -0,0 +1,351 @@
function i(e) {
this.arr = [];
this.len = 0;
undefined == e && (e = "0");
this.base = e;
this.init();
}
i.prototype.init = function () {
var e = this.base.slice(-1);
if (e.charCodeAt() > 57) {
var o = {
K: 3,
M: 6,
B: 9,
T: 12,
P: 15,
E: 18,
Z: 21,
Y: 24,
N: 27,
D: 30,
S: 33,
U: 36,
Q: 39
}[e];
var t = this.base.slice(0, this.base.length - 1).split(".");
for (var i = 0; i < o - 1; i++) {
this.arr.push(0);
}
if (t.length > 1) {
var n = parseInt(t[1]);
n = Math.floor(n / Math.pow(10, t[1].length - 1));
this.arr.push(n);
} else {
this.arr.push(0);
}
var a = t[0].split("");
for (var c = a.length - 1; c >= 0; c--) {
this.arr.push(parseInt(a[c]));
}
} else {
var s = this.base.split("");
for (var l = s.length - 1; l >= 0; l--) {
this.arr.push(parseInt(s[l]));
}
}
this.len = this.arr.length;
this.base = this.getShortString();
};
i.prototype.alterationBase = function () {
var e = arguments.length > 0 && undefined !== arguments[0] ? arguments[0] : "0";
this.arr = [];
this.len = 0;
this.base = e;
this.init();
};
i.prototype.plus = function (e) {
var o = [];
var t = Math.max(e.len, this.len);
var i = false;
for (var n = 0; n < t; n++) {
if (undefined !== e.arr[n] && undefined !== this.arr[n]) {
var a = e.arr[n] + this.arr[n];
if (i) {
a += 1;
i = false;
}
if (a >= 10) {
i = true;
o[n] = a % 10;
} else {
o[n] = a;
}
} else {
var c = undefined !== e.arr[n] ? e.arr[n] : this.arr[n];
if (i) {
c += 1;
i = false;
}
if (c >= 10) {
i = true;
o[n] = c % 10;
} else {
o[n] = c % 10;
}
}
}
i && o.push(1);
this.arr = o;
this.len = this.arr.length;
this.base = this.getShortString();
};
i.prototype.minus = function (e) {
var o = [];
if (e.len > this.len || e.len == this.len && this.arr[this.len - 1] < e.arr[this.len - 1]) {
o.push(0);
} else {
var t = 0;
var i = this.len;
var n = 0;
for (var a = 0; a < i && (n = this.arr[a], n -= t, a < e.len && (n -= e.arr[a]), n < 0 ? (t = 1, n += 10) : t = 0, !(n < 0)); a++) {
o.push(n);
}
0 != t && (o = [0]);
}
a = this.len = o.length;
for (var c = -1; a-- && 0 == o[a];) {
c = Math.max(1, a);
}
c >= 0 && o.splice(c, this.len - c);
this.arr = o;
this.len = this.arr.length;
return this.base = this.getShortString();
};
i.prototype.mult = function (e) {
var o = [];
var t = 0;
var i = e + "";
var n = Math.max(this.len, i.length);
for (var a = 0; a <= n && (undefined != this.arr[a] || 0 != t); a++) {
var c = 0;
undefined !== this.arr[a] && (c = this.arr[a] * e);
if (t > 0) {
c += t;
t = 0;
}
c > 9 && (t = Math.floor(c / 10));
c %= 10;
o[a] = c;
}
if (t > 0) {
if (t > 9) {
var s = Math.floor(t / 10);
t %= 10;
o.push(t);
o.push(s);
} else {
o.push(t);
}
}
"10" == this.arr[0] || this.arr[1];
this.arr = o;
this.len = this.arr.length;
this.getShortString();
return this;
};
i.prototype.mult2 = function (e) {
var o = (e += "").split("");
var t = 0;
var n = new i();
for (var a = o.length - 1; a >= 0; a--) {
var c = new i().copy(this);
c.mult(parseInt(e.charAt(a)));
c.mult10(t);
t++;
n.plus(c);
}
this.copy(n);
return this;
};
i.prototype.mult10 = function (e) {
for (undefined === e && (e = 1); e--;) {
this.arr.unshift(0);
}
this.len = this.arr.length;
return this;
};
i.prototype.div = function (e) {
var o = false;
var t = [];
var i = 0;
var n = 0;
var a = this.len;
for (var c = 0; a--;) {
c = 10 * i + this.arr[a];
n = Math.floor(c / e);
if (o || n > 0) {
t.push(n);
o = true;
}
i = c % e;
}
this.len = t.length;
if (0 == this.len) {
this.arr = [1];
this.len = 1;
} else {
this.arr = t;
this.arr.reverse();
}
"10" == this.arr[0] || this.arr[1];
this.getShortString();
return this;
};
i.prototype.getShortString = function () {
var e = 0;
var o = 0;
var t = "";
var i = 0;
if (1 == (e = this.len) && 0 == this.arr[0]) {
return "0";
}
o = e % 3;
i = Math.floor(e / 3);
if (0 == o) {
o = 3;
i--;
}
for (o = e - o; e-- > o;) {
t += this.arr[e];
}
i > 0 && this.arr[e] > 0 && (t += "." + this.arr[e]);
return t + ["", "K", "M", "B", "T", "P", "E", "Z", "Y", "N", "D", "S", "U", "Q"][i];
};
i.prototype.getAnyNumStr = function () {
var e = "";
for (var o = this.len - 1; o >= 0; o--) {
e += this.arr[o];
}
return e;
};
i.prototype.bigger = function (e) {
if (this.len > e.len) {
return true;
}
if (this.len < e.len) {
return false;
}
for (var o = this.len; o--;) {
if (this.arr[o] > e.arr[o]) {
return true;
}
if (this.arr[o] < e.arr[o]) {
return false;
}
}
return false;
};
i.prototype.biggerIncludeEqual = function (e) {
if (this.len > e.len) {
return true;
}
if (this.len < e.len) {
return false;
}
for (var o = this.len; o--;) {
if (this.arr[o] > e.arr[o]) {
return true;
}
if (this.arr[o] < e.arr[o]) {
return false;
}
}
return true;
};
i.prototype.bigger2 = function (e) {
if (this.len > e.len) {
return true;
}
if (this.len < e.len) {
return false;
}
for (var o = this.len; o--;) {
if (this.arr[o] > e.arr[o]) {
return true;
}
if (this.arr[o] < e.arr[o]) {
return false;
}
}
return true;
};
i.prototype.copy = function (e) {
this.arr = e.arr.concat();
this.len = e.len;
this.base = e.base;
this.getShortString();
return this;
};
i.prototype.zero = function (e) {
this.arr = [];
this.len = 0;
this.base = "0";
};
i.prototype.isZero = function (e) {
return !(0 != this.len && 1 != this.len || 0 != this.arr.length && 0 != this.arr[0]);
};
i.prototype.isOne = function (e) {
return 1 != this.len || 1 != this.arr[0];
};
i.prototype.noZero = function () {
if (this.isZero()) {
this.arr = [1];
this.len = 1;
this.base = "1";
}
};
i.prototype.div10 = function (e) {
undefined == e && (e = 1);
for (; e > 0; e--) {
this.arr.shift();
}
this.len = this.arr.length;
this.len <= 0 && this.zero();
this.getShortString();
return this;
};
i.prototype.divPresent = function (e) {
var o = this.len - e.len;
if (o >= 3) {
return 0;
}
if (o < -3) {
return 10;
}
var t = Math.max(this.len, e.len);
var i = "";
var n = "";
for (o = Math.min(3, t); o--;) {
--t < this.len && (i += this.arr[t]);
t < e.len && (n += e.arr[t]);
}
this.getShortString();
return parseFloat(n) / parseFloat(i);
};
i.prototype.present100 = function (e) {
if (0 == e) {
return this;
} else {
if (e <= 1e3) {
return this.mult(e).div10(2);
} else {
if (e <= 1e4) {
return e = Math.floor(e / 10), this.mult(e).div10(1);
} else {
if (e <= 1e5) {
return e = Math.floor(e / 100), this.mult(e);
} else {
return this.mult(e).div10(2);
}
}
}
}
};
i.prototype.getDetails = function () {
return {
display: this.getShortString(),
real: this.getAnyNumStr()
};
};
module.exports = i;
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "f827ba0d-a012-446a-bfad-bd316a1cdb57",
"isPlugin": false
}
+318
View File
@@ -0,0 +1,318 @@
function i(e, o) {
if (!(e instanceof o)) {
throw new TypeError("Cannot call a class as a function");
}
}
function n(e, o) {
for (var t = 0; t < o.length; t++) {
var i = o[t];
i.enumerable = i.enumerable || false;
i.configurable = true;
"value" in i && (i.writable = true);
Object.defineProperty(e, i.key, i);
}
}
function a(e, o, t) {
o && n(e.prototype, o);
t && n(e, t);
return e;
}
var c = function () {
function o() {
i(this, o);
this.VideoSuccessCallBack = null;
this.VideoFailureCallBack = null;
this.PlatformTool = null;
var t = null;
if (window.swan) {
console.log("加载百度信息, 并初始化");
this.PlatformTool = require("_baidu");
this.PlatformTool.doInitialize();
} else if (GlobData.isHuaWeiMiNiGame) {
console.log("加载华为信息, 并初始化....");
this.PlatformTools = require("huaweiUtil");
this.PlatformTools.initHuawei();
} else if (cc.sys.platform == cc.sys.OPPO_GAME) {
null != oppoUtil && cc.sys.platform === cc.sys.OPPO_GAME && oppoUtil.initQQShow();
} else if (window.h5api) {
console.log("加载4399渠道信息, 并初始化....");
GlobData.is4399MiNiGame = true;
} else if (window.tt) {
null != TouTiaoTools && window.tt && TouTiaoTools.initQQShow();
} else if (GlobData.isUcMiNiGame) {
console.log("加载UC信息, 并初始化");
this.PlatformTool = require("uc");
this.PlatformTool.doInitialize();
} else if (window.qq) {
this.PlatformTool = require("qq");
this.PlatformTool.doInitialize();
this.PlatformTool.kaipingVideo();
} else if ("undefined" != typeof mz_jsb) {
MeiZuUtil.initQQShow();
} else if (window.ks) {
t = require("KuaishouUtil");
} else if (undefined != window.vivoUtil) {
window.GameConfig.levelOrder = window.levelOrder;
window.vivoUtil.initQQShow();
} else {
cc.sys.platform === cc.sys.ANDROID && GlobData.doInitialize();
}
if (t) {
this.PlatformTool = new t();
this.PlatformTool.doInitialize && this.PlatformTool.doInitialize();
}
}
a(o, [{
key: "executeShowBanner",
value: function () {
console.log("调用插屏");
if (cc.sys.platform !== cc.sys.ANDROID) {
undefined != window.vivoUtil && vivoUtil.showAd_Banner();
"undefined" != typeof mz_jsb && MeiZuUtil.showAd_Banner();
cc.sys.platform === cc.sys.OPPO_GAME && null != oppoUtil && oppoUtil.showAd_Banner();
if (null != TouTiaoTools && window.tt) {
TouTiaoTools.showBanner();
} else {
this.PlatformTool && this.PlatformTool.executeShowBanner && this.PlatformTool.executeShowBanner();
}
} else {
GlobData.showBanner();
}
}
}, {
key: "executeYinSiBtn",
value: function () {
cc.sys.platform !== cc.sys.ANDROID || GlobData.executeYinSiBtn();
}
}, {
key: "executeHideBalock",
value: function () {
if (window.qq) {
if (!this.PlatformTool) {
return;
}
this.PlatformTool.closeBlockAd && this.PlatformTool.closeBlockAd();
}
}
}, {
key: "winVideo",
value: function () {
"undefined" != typeof mz_jsb && MeiZuUtil.winVideo();
window.ks && this.PlatformTool.Suijivideo && this.PlatformTool.Suijivideo(GameConfig.randomShowvideo, null);
if (window.qq) {
if (!this.PlatformTool) {
return;
}
this.PlatformTool.winVideo && this.PlatformTool.winVideo();
}
}
}, {
key: "executeShowVivoChaPing",
value: function () {
if (cc.sys.platform !== cc.sys.ANDROID) {
undefined != window.vivoUtil && vivoUtil.showAd_ChaPing();
null != oppoUtil && cc.sys.platform == cc.sys.OPPO_GAME && oppoUtil.showAd_ChaPing();
window.qg && (window.sendDesk || window.GameConfig.sendDesk) && window.qg.hasShortcutInstalled({
success: function (e) {
if (e) {
console.log("桌面有图标:", e);
} else {
console.log("桌面无图标:", e);
window.qg.installShortcut({
success: function () {},
fail: function (e) {},
complete: function () {}
});
}
}.bind(this),
fail: function (e) {}.bind(this),
complete: function () {}.bind(this)
});
"undefined" != typeof mz_jsb && MeiZuUtil.showAd_ChaPing();
this.PlatformTool && this.PlatformTool.executeJieSuanChaPing && this.PlatformTool.executeJieSuanChaPing();
} else {
GlobData.showInterstitial();
}
}
}, {
key: "showMainCaiqian",
value: function () {
var e = arguments.length > 0 && undefined !== arguments[0] && arguments[0];
this.PlatformTool && this.PlatformTool.showMainCaiqian && this.PlatformTool.showMainCaiqian(e);
}
}, {
key: "executeShowVIVOInGame",
value: function () {
if (undefined != window.vivoUtil) {
vivoUtil.showAdInGame();
} else if (null != oppoUtil && cc.sys.platform === cc.sys.OPPO_GAME) {
oppoUtil.showAdInGame();
} else {
"undefined" != typeof mz_jsb && MeiZuUtil.showAd_Banner();
}
this.PlatformTool && this.PlatformTool.executeShowBanner && this.PlatformTool.executeShowBanner();
}
}, {
key: "executeHideBanner",
value: function () {
if (cc.sys.platform !== cc.sys.ANDROID) {
null != oppoUtil && cc.sys.platform === cc.sys.OPPO_GAME && oppoUtil.closeBanner();
null != TouTiaoTools && window.tt && TouTiaoTools.hideBanner();
this.PlatformTool && this.PlatformTool.executeHideBanner && this.PlatformTool.executeHideBanner();
} else {
GlobData.destroyBanner();
}
}
}, {
key: "executeRandVideo",
value: function () {
console.log("调用随机视频");
null != TouTiaoTools && window.tt && TouTiaoTools.randomVideo();
"undefined" != typeof mz_jsb && MeiZuUtil.randomVideo();
if (this.PlatformTool) {
console.log("随机视频-----:" + GameConfig.randomShowvideo);
this.PlatformTool.Suijivideo && this.PlatformTool.Suijivideo(GameConfig.randomShowvideo, null);
}
}
}, {
key: "executeKaiPing",
value: function () {
this.PlatformTool && this.PlatformTool.Suijivideo && this.PlatformTool.Suijivideo(GameConfig.randomSplshvideo, null);
}
}, {
key: "executeShowInterstitial",
value: function () {
if (!GlobData.isUcMiNiGame) {
if (null != TouTiaoTools && window.tt) {
TouTiaoTools.showChaPing();
} else {
this.PlatformTool && this.PlatformTool.executeShowInterstitial && this.PlatformTool.executeShowInterstitial();
}
}
}
}, {
key: "executeVideoRecorder",
value: function () {
if (null != TouTiaoTools && window.tt) {
TouTiaoTools.luzhiKaishi();
} else {
this.PlatformTool && this.PlatformTool.executeRecorder && this.PlatformTool.executeRecorder();
}
}
}, {
key: "executeStopVideoRecorder",
value: function () {
if (null != TouTiaoTools && window.tt) {
TouTiaoTools.luzhijieshu();
} else {
this.PlatformTool && this.PlatformTool.stopRecorder && this.PlatformTool.stopRecorder();
}
}
}, {
key: "executeShareRecorderVideo",
value: function (e, o) {
if (null != TouTiaoTools && window.tt) {
TouTiaoTools.fenxiangVideo(e, o);
} else if (this.PlatformTool) {
this.PlatformTool.executeShareRecorder && this.PlatformTool.executeShareRecorder(e, o);
} else {
e && e();
}
}
}, {
key: "executeShowAwardVideo",
value: function (e, o) {
if (GlobData.is4399MiNiGame) {
console.log("当前平台为4399平台, 开始实例化相关参数");
return void window.h5api.canPlayAd(function (t) {
console.log("是否可播放广告", t.canPlayAd, "剩余次数", t.remain);
window.h5api.playAd(function (t) {
console.log("代码:" + t.code + ",消息:" + t.message);
if (1e4 === t.code) {
console.log("开始播放");
} else if (10001 === t.code) {
console.log("播放结束");
e && e();
} else {
console.log("广告异常");
o && o();
}
});
});
}
if (cc.sys.platform !== cc.sys.ANDROID) {
if ("undefined" == typeof mz_jsb) {
if (null != TouTiaoTools && window.tt) {
TouTiaoTools.getVideoAd(e, o);
} else if (null == oppoUtil || cc.sys.platform !== cc.sys.OPPO_GAME) {
console.log("执行了这个?");
if (undefined == window.vivoUtil) {
if (this.PlatformTool) {
this.PlatformTool.executeShowAwardVideo && this.PlatformTool.executeShowAwardVideo(e, o);
} else {
e && e();
}
} else {
vivoUtil.getVideoAd(e, o);
}
} else {
oppoUtil.getVideoAd(e, o);
}
} else {
MeiZuUtil.getVideoAd(e, o);
}
} else {
GlobData.showVideo(e, o);
}
}
}, {
key: "executeShowPushBox",
value: function () {
if (null != oppoUtil && cc.sys.platform === cc.sys.OPPO_GAME) {
oppoUtil.closeBanner();
oppoUtil.showMoreGame();
}
GlobData.is4399MiNiGame && window.h5api.showRecommend();
null != TouTiaoTools && window.tt && TouTiaoTools.moreGame();
this.PlatformTool && this.PlatformTool.executeShowPushBox && this.PlatformTool.executeShowPushBox();
}
}, {
key: "addZhuoMianJianCe",
value: function (e, o) {
(window.qg || "undefined" != typeof mz_jsb) && window.qg.hasShortcutInstalled({
success: function (t) {
if (t) {
e && e();
} else {
o && o();
}
},
fail: function (e) {},
complete: function () {}
});
this.Platform && this.Platform.isInstalledShortcut && this.Platform.isInstalledShortcut(e, o);
}
}, {
key: "sendToDesktop",
value: function (e) {
var o = arguments.length > 1 && undefined !== arguments[1] && arguments[1];
cc.sys.platform !== cc.sys.VIVO_GAME && cc.sys.platform !== cc.sys.OPPO_GAME && "undefined" == typeof mz_jsb || window.qg.installShortcut({
success: function () {
e && (e.active = false);
},
fail: function (e) {
null != oppoUtil && cc.sys.platform === cc.sys.OPPO_GAME && oppoUtil.showAd_Banner();
},
complete: function () {}
});
this.PlatformTool && this.PlatformTool.showAddZhuomian && this.PlatformTool.showAddZhuomian(e, o);
}
}, {
key: "executeBlockAdShow",
value: function (e, o) {
window.swan || this.PlatformTool && this.PlatformTool.executeBlockAdShow && this.PlatformTool.executeBlockAdShow(e, o);
}
}]);
return o;
}();
module.exports = c;
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "de47e419-a04e-4f92-a225-ec9517aaafb2",
"isPlugin": false
}
+13
View File
@@ -0,0 +1,13 @@
cc.Class({
extends: cc.Component,
properties: {
ovVideoImg: {
default: null,
type: cc.SpriteFrame,
displayName: "OV视频图标"
}
},
start: function () {
(window.tt || window.qq) && this.ovVideoImg && (this.node.getComponent(cc.Sprite).spriteFrame = this.ovVideoImg);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "080d9103-f26d-4cd1-ba4a-9781a5d18e9a",
"isPlugin": false
}
+73
View File
@@ -0,0 +1,73 @@
cc.Class({
extends: cc.Component,
properties: {
showPic: cc.Sprite
},
onLoad: function () {
this.showID = 0;
this.changeTime = 0;
if ((window.swan || window.tt) && window.GameConfig.iconList && window.GameConfig.packageList) {
if (window.GameConfig.packageList.length <= 0 || window.GameConfig.packageList.length <= 0) {
this.node.active = false;
} else {
this.showIcon();
}
} else {
this.node.active = false;
}
},
showIcon: function () {
window.swan && cc.loader.load(window.GameConfig.iconList[this.showID], function (e, o) {
e || (this.showPic.spriteFrame = new cc.SpriteFrame(o));
}.bind(this));
},
touchIconCallBack: function () {
if (window.tt) {
"ios" === window.tt.getSystemInfoSync().platform && window.tt.showToast({
title: " iOS不支持此功能"
});
window.tt.showMoreGamesModal({
appLaunchOptions: [{
appId: "",
query: "foo=bar&baz=qux",
extraData: {}
}],
success: function (e) {},
fail: function (e) {}
});
} else if (window.qg) {
window.qg.navigateToMiniGame({
pkgName: window.GameConfig.packageList[this.showID],
path: "?page=pageB",
extraData: {
from: "脑洞侦探"
},
success: function () {},
fail: function (e) {
console.log(JSON.stringify(e));
}
});
} else {
window.swan && window.swan.navigateToMiniProgram({
appKey: window.GameConfig.packageList[this.showID],
path: "/path/page/0",
extraData: {
from: "脑洞侦探"
},
success: function () {},
fail: function (e) {
console.log(JSON.stringify(e));
}
});
}
},
update: function (e) {
this.changeTime += e;
if (this.changeTime >= 3) {
this.changeTime = 0;
this.showID += 1;
this.showID >= window.GameConfig.iconList.length && (this.showID = 0);
this.showIcon();
}
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "b512ce6f-8e25-452f-aba3-eade1767db44",
"isPlugin": false
}
+32
View File
@@ -0,0 +1,32 @@
cc.Class({
extends: cc.Component,
properties: {},
start: function () {
console.log("到这1111111111");
cc.global.levelDataScript = this;
cc.global.levelDate = cc.playerData.game1_level;
cc.global.levellist = [].concat(cc.global.game1_levelOrder);
cc.global.gameModel = "game1";
this.creatorXuanguan();
},
updateData: function (e) {
console.log("进来执行吗?" + e);
cc.playerData.game1_level = e;
cc.global.levelDate = cc.playerData.game1_level;
cc.global.savePlayerData();
},
creatorXuanguan: function () {
console.log("到这22222222222");
var e = this;
cc.loader.loadRes("prefab/ui/Hall_XuanGuan", function (o, t) {
if (!o && t instanceof cc.Prefab) {
console.log("到这33333333333333");
var i = cc.instantiate(t);
i.parent = e.node;
i.getComponent("LevelScript").initdata(cc.global.levelDate, cc.global.levellist);
i.zIndex = 999;
i.position = cc.v2(0, 0);
}
});
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "e63c746e-36e2-47df-a898-1ec3aa1afeed",
"isPlugin": false
}
+16
View File
@@ -0,0 +1,16 @@
cc.Class({
extends: cc.Component,
properties: {},
onLoad: function () {
window.qg || window.qq || (this.node.active = false);
},
start: function () {
var e = this;
cc.PlatformTools.addZhuoMianJianCe(function () {
e.node.active = false;
}, null);
},
touchEventCallBack: function (e) {
cc.PlatformTools.sendToDesktop(this.node, false);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "3fd71847-a25d-4f23-917d-4323856c636d",
"isPlugin": false
}
+17
View File
@@ -0,0 +1,17 @@
cc.Class({
extends: cc.Component,
properties: {},
start: function () {},
onShowImg_bendi: function (e) {
this.node.getComponent(cc.Sprite).spriteFrame = null;
cc.loader.loadRes(e, function (e, o) {
e || (this.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(o));
}.bind(this));
},
onShowImg_server: function (e) {
this.node.getComponent(cc.Sprite).spriteFrame = null;
cc.loader.load(e, function (e, o) {
e || (this.node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(o));
}.bind(this));
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "f9017b25-790e-4380-b339-96f9dcaefd6a",
"isPlugin": false
}
+77
View File
@@ -0,0 +1,77 @@
cc.Class({
extends: cc.Component,
properties: {
contentNode: {
default: null,
type: cc.Node,
displayName: "签到内容节点"
},
qiandaoBtn: {
default: null,
type: cc.Node,
displayName: "普通签到按钮"
},
shuabeiBtn: {
default: null,
type: cc.Node,
displayName: "双倍领取按钮"
},
dayNode: null
},
start: function () {
cc.PlatformTools.executeShowBanner();
cc.PlatformTools.executeShowInterstitial();
this.onShowUI();
},
onShowUI: function () {
this.dayNode = this.contentNode.children;
var e = cc.global.signInfo.days;
if (0 == cc.global.signInfo.allow) {
console.log("今日已签到");
this.qiandaoBtn.active = false;
this.shuabeiBtn.active = false;
}
for (var o = 0; o < this.dayNode.length; o++) {
var t = this.dayNode[o].getChildByName("yilingqu");
t.active = false;
o < e && (t.active = true);
}
},
onSuccessSign: function (e) {
var o = cc.global.signInfo.days;
var t = cc.global.signInfo.allow;
console.log("days:" + o);
6 == o && 200 == e && (e += 200);
if (0 != t) {
GlobData.ShowAsk(" 签到成功\n 获得" + e + "个金币");
cc.global.signInfo.allow = false;
cc.global.signInfo.days++;
cc.playerData.coin += e;
cc.global.savePlayerData();
cc.sys.localStorage.setItem("signInfo", JSON.stringify(cc.global.signInfo));
this.onCloseUI();
} else {
console.log("今日已签到");
}
},
onClickBtnEvent: function (e) {
cc.global.Source.onPlayBtnEffect("buttonClick");
switch (e.target.name) {
case "qandaoBtn":
this.onSuccessSign(100);
break;
case "shuangbeiBtn":
var o = this;
cc.PlatformTools.executeShowAwardVideo(function () {
o.onSuccessSign(200);
}, function () {});
break;
case "CloseBtn":
this.onCloseUI();
}
},
onCloseUI: function () {
cc.global.Source.onPlayBtnEffect("buttonClick");
GlobData.GameBtnClose(this.node, true);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "db5b02ca-42db-4fb0-a53b-3b2da7f8efff",
"isPlugin": false
}
+84
View File
@@ -0,0 +1,84 @@
cc.Class({
extends: cc.Component,
properties: {
Soldier: {
default: null,
type: sp.Skeleton,
displayName: "动画"
},
startTime: {
default: 0,
displayName: "起始延迟时间"
},
endTime: {
default: 0,
displayName: "结束延迟时间"
},
slotName: {
default: "",
displayName: " 卡槽名称"
},
SkinName: {
default: "",
displayName: " 皮肤名称"
},
targetAttaName: {
default: "",
displayName: " 卡槽附件名称"
},
aniNameHuanyuan: {
default: "",
displayName: "要还原的动画名字"
},
hideNode: {
type: cc.Node,
default: [],
displayName: "需要隐藏的节点"
},
showNode: {
type: cc.Node,
default: [],
displayName: "需要显示的节点"
},
eventNode_over: {
default: [],
type: cc.Node,
displayName: "需要合并的事件节点"
}
},
start: function () {
this.node.switchEvent = this.switchEvent.bind(this);
this.xunhuan = true;
},
switchEvent: function () {
var e = this;
console.log("播放动画");
cc.tween(this.node).delay(this.startTime).call(function () {
e.changeCloth(e.Soldier, e.slotName, e.SkinName, e.targetAttaName);
setTimeout(function () {
if (e.hideNode) {
for (var o = 0; o < e.hideNode.length; o++) {
e.hideNode[o].active = false;
}
}
if (e.showNode) {
for (var t = 0; t < e.showNode.length; t++) {
e.showNode[t].active = true;
}
}
for (var i = 0; i < e.eventNode_over.length; i++) {
e.eventNode_over[i] && e.eventNode_over[i].switchEvent();
}
}, e.endTime);
}).start();
},
changeCloth: function (e, o, t, i) {
console.log("change cloth:", o, t, i);
var n = e.findSlot(o);
var a = e.skeletonData.getRuntimeData();
var c = a.findSkin(t);
var s = a.findSlotIndex(o);
var l = c.getAttachment(s, i);
n.setAttachment(l);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "c2d02a0b-a2db-4388-ba29-16d13f7eaf3b",
"isPlugin": false
}
+402
View File
@@ -0,0 +1,402 @@
window.TouTiaoTools = {
ingameBanner: false,
bannerID: "2onvhs1gcrk890gili",
videoID: "4j4blb9dgc23c015ij",
chapingID: "i79jh2m071b12lqpb0",
AppName: "我眼神贼准",
ShareID: "413bi0j44jf21634j5",
ShareDataTitle: "快来插这个大菠萝",
videoCallbackSuccess: null,
videoCallbackFaile: null,
videoAd: null,
interstitialAd: null,
randomVideo: function () {
TouTiaoTools.GaiLv(window.ServerConfigBd.randomShowvideo) && TouTiaoTools.getVideoAd(null, null);
},
KaipingVideo: function () {
TouTiaoTools.GaiLv(window.ServerConfigBd.kaiping) && TouTiaoTools.getVideoAd(null, null);
},
getVideoAd: function (e, o) {
this.videoCallbackSuccess = e;
this.videoCallbackFaile = o;
if (window.tt) {
TouTiaoTools.videoAd.show().then(function () {
return console.log("激励视频 广告显示");
}).catch(function () {
TouTiaoTools.videoAd.load().then(function () {
return TouTiaoTools.videoAd.show();
}).catch(function (e) {
console.log("激励视频 广告显示失败");
tt.showToast({
title: "广告加载失败,请稍后重试!",
icon: "none",
duration: 1e3,
success: function (e) {
console.log("".concat(e));
},
fail: function (e) {
console.log("showToast 调用失败");
}
});
});
});
} else {
TouTiaoTools.AdSuccess();
}
},
showShare: function () {
if (window.tt) {
console.log("sdk share page....");
var e = TouTiaoTools.getShareData();
if (!e || undefined === e.title) {
console.log("sdk share page....no data");
return false;
}
tt.showShareMenu({
withShareTicket: true
});
tt.onShareAppMessage(function () {
return e;
});
}
},
moreGame: function () {
if ("ios" !== tt.getSystemInfoSync().platform) {
tt.showMoreGamesModal({
appLaunchOptions: [{
appId: "",
query: "",
extraData: {}
}],
success: function (e) {
console.log("success", e.errMsg);
},
fail: function (e) {
console.log("fail", e.errMsg);
}
});
} else {
tt.showToast({
title: "iOS不支持此功能"
});
}
},
getShareData: function () {
return TouTiaoTools._randomShareDatas[0];
},
_randomShareDatas: [],
showBanner: function () {
if (window.tt && window.ServerConfigBd.showbanner) {
console.log("调用banner");
if (null == TouTiaoTools.GAME_QQ_BANNER) {
var e = tt.getSystemInfoSync().windowWidth;
var o = tt.getSystemInfoSync().windowHeight;
TouTiaoTools.GAME_QQ_BANNER = tt.createBannerAd({
adUnitId: TouTiaoTools.bannerID,
style: {
top: o - .8 * e * 0.24444444444444444 - 35,
left: (e - .8 * e) / 2,
adIntervals: 30,
width: 200
}
});
TouTiaoTools.GAME_QQ_BANNER.onResize(function (o) {
console.log("改变size");
TouTiaoTools.GAME_QQ_BANNER.style.left < (e - o.width) / 2 && (TouTiaoTools.GAME_QQ_BANNER.style.left = (e - o.width) / 2);
});
TouTiaoTools.GAME_QQ_BANNER.onError(function () {
TouTiaoTools.GAME_QQ_BANNER = null;
});
TouTiaoTools.GAME_QQ_BANNER.onLoad(function () {
console.log("is toutiao3 showBanner");
TouTiaoTools.GAME_QQ_BANNER.show().then(function () {
console.log("banner显示成功");
}).catch(function (e) {
console.log("广告组件出现问题", e);
TouTiaoTools.GAME_QQ_BANNER.offLoad();
TouTiaoTools.GAME_QQ_BANNER.offResize();
TouTiaoTools.GAME_QQ_BANNER = null;
});
});
} else {
TouTiaoTools.GAME_QQ_BANNER.show();
}
}
},
hideBanner: function () {
if (window.tt) {
console.log("hide banner");
if (TouTiaoTools.GAME_QQ_BANNER) {
TouTiaoTools.GAME_QQ_BANNER.destroy(), TouTiaoTools.GAME_QQ_BANNER = null;
}
}
},
share_successF: null,
share_failF: null,
GAME_SHARE_NOW: false,
share_startTime: 0,
share_MaxTime: 0,
Game_InScene: false,
GAME_QQ_BANNER: null,
GAME_SET_BANNER: null,
GAME_CESHI_BANNER: null,
recorder: null,
shareTo: function () {
window.tt && tt.shareAppMessage({
templateId: "d8kcs176ro73ipnrqg",
query: "",
success: function () {
console.log("分享成功");
},
fail: function (e) {
console.log("分享失败");
}
});
},
initQQShow: function () {
if (window.tt) {
window.ServerConfigBd = window.GameConfig;
setInterval(function () {
TouTiaoTools.showChaPing();
}, 4e4);
setInterval(function () {
TouTiaoTools.showBanner();
}, 1e4);
TouTiaoTools.recorder = tt.getGameRecorderManager();
if (tt.createRewardedVideoAd) {
TouTiaoTools.videoAd = tt.createRewardedVideoAd({
adUnitId: TouTiaoTools.videoID
});
TouTiaoTools.videoAd.load();
TouTiaoTools.videoAd.onClose(function (e) {
if (1 == e.isEnded) {
TouTiaoTools.AdSuccess();
} else if (window.ServerConfigBd.showModal) {
tt.showModal({
title: "未观看完视频",
content: "观看完视频才能获得奖励哦",
success: function (e) {
if (e.confirm) {
TouTiaoTools.videoAd.show().then(function () {
return console.log("激励视频 广告显示");
}).catch(function () {
TouTiaoTools.videoAd.load().then(function () {
return TouTiaoTools.videoAd.show();
}).catch(function (e) {
console.log("激励视频 广告显示失败");
tt.showToast({
title: "广告加载失败,请稍后重试!",
icon: "none",
duration: 1e3,
success: function (e) {
console.log("".concat(e));
},
fail: function (e) {
console.log("showToast 调用失败");
}
});
});
});
} else {
e.cancel;
TouTiaoTools.AdFaile();
tt.showToast({
title: "未观看完整视频!",
icon: "none",
duration: 1e3,
success: function (e) {
console.log("".concat(e));
},
fail: function (e) {
console.log("showToast调用失败");
}
});
}
},
fail: function (e) {
console.log("showModal调用失败");
TouTiaoTools.AdFaile();
tt.showToast({
title: "未观看完整视频!",
icon: "none",
duration: 1e3,
success: function (e) {
console.log("".concat(e));
},
fail: function (e) {
console.log("showToast调用失败");
}
});
}
});
} else {
TouTiaoTools.AdFaile();
tt.showToast({
title: "未观看完整视频!",
icon: "none",
duration: 1e3,
success: function (e) {
console.log("".concat(e));
},
fail: function (e) {
console.log("showToast调用失败");
}
});
}
});
}
TouTiaoTools.showShare();
var e = window.GlobData.sceneIDTrue();
console.log("a:" + e);
if (window.GlobData.sceneIDTrue()) {
console.log("陈宫");
TouTiaoTools.KaipingVideo();
} else {
console.log("失败-----");
}
}
},
showChaPing: function () {
window.tt && window.ServerConfigBd.showChaping && TouTiaoTools.showChaPing1();
},
canReTry: true,
showChaPing1: function () {
console.log("-- TT 触发插屏");
TouTiaoTools.interstitialAd = tt.createInterstitialAd({
adUnitId: TouTiaoTools.chapingID
});
TouTiaoTools.interstitialAd.load().then(function () {
TouTiaoTools.interstitialAd.show().then(function () {
console.log("-- TT 展示插屏广告成功!");
}).catch(function (e) {
console.error("-- TT 展示插屏广告失败!err =", e);
});
}).catch(function (e) {
console.error("-- TT 加载插屏广告失败,err =", e);
});
},
AdSuccess: function () {
if (null != TouTiaoTools.videoCallbackSuccess) {
TouTiaoTools.videoCallbackSuccess();
TouTiaoTools.videoCallbackSuccess = null;
}
},
AdFaile: function () {
if (null != TouTiaoTools.videoCallbackFaile) {
TouTiaoTools.videoCallbackFaile();
TouTiaoTools.videoCallbackFaile = null;
}
},
startTime: 0,
endTime: 0,
luzhiKaishi: function () {
if (window.tt) {
TouTiaoTools.recorder.stop();
tt.onShow(function (e) {
TouTiaoTools.recorder.resume();
});
tt.onHide(function () {
TouTiaoTools.recorder.pause();
});
TouTiaoTools.recorder.onStart(function (e) {});
TouTiaoTools.overvideo = false;
setTimeout(TouTiaoTools.startLuzhi, 300);
}
},
startLuzhi: function () {
if (window.tt) {
console.log("录屏开始");
TouTiaoTools.recorder.start({
duration: 6e4
});
TouTiaoTools.startTime = new Date().getTime();
}
},
videoPath: "",
overvideo: false,
GaiLv: function (e) {
var o = 1 + Math.floor(100 * Math.random());
console.log("当前概率为:" + o);
return o <= e;
},
IS_VIDEO: false,
luzhijieshu: function () {
if (window.tt) {
console.log("luzhijieshu");
tt.offShow(function () {});
tt.offHide(function () {});
TouTiaoTools.recorder.stop();
TouTiaoTools.endTime = new Date().getTime();
TouTiaoTools.recorder.onStop(function (e) {
TouTiaoTools.videoPath = e.videoPath;
console.log("录屏结束:" + e.videoPath);
TouTiaoTools.overvideo = true;
});
}
},
randomsharelp: function () {
console.log("当前随机视频的概率为" + window.ServerConfigBd.randomShare);
TouTiaoTools.GaiLv(window.ServerConfigBd.randomShare) && TouTiaoTools.fenxiangVideo(null, null);
},
fenxiangVideo: function (e, o) {
if (window.tt) {
if (TouTiaoTools.endTime - TouTiaoTools.startTime <= 3500) {
console.log("fenxiang meiyoushipin");
tt.showToast({
title: "录屏时间少于3秒,分享失败!",
icon: "none",
duration: 1e3,
success: function (e) {
console.log("".concat(e));
},
fail: function (e) {
console.log("showToast调用失败");
}
});
return void (o && o());
}
console.log("fenxiang shipin");
tt.shareAppMessage({
templateId: TouTiaoTools.ShareID,
channel: "video",
title: "点击这里,开始游戏!",
desc: TouTiaoTools.ShareDataTitle,
extra: {
videoPath: TouTiaoTools.videoPath,
videoTopics: ["小游戏", TouTiaoTools.AppName, TouTiaoTools.ShareDataTitle]
},
success: function () {
console.log("分享视频成功111");
tt.showToast({
title: "分享成功",
icon: "none",
duration: 1e3,
success: function (e) {
console.log("".concat(e));
},
fail: function (e) {
console.log("showToast调用失败");
}
});
e && e();
},
fail: function (e) {
console.log(e);
tt.showToast({
title: "分享失败",
icon: "none",
duration: 1e3,
success: function (e) {
console.log("".concat(e));
},
fail: function (e) {
console.log("showToast调用失败");
}
});
o && o();
console.log("分享视频失败");
}
});
}
}
};
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "894d246d-333c-438a-b2f2-60bf891ec0bd",
"isPlugin": false
}
+58
View File
@@ -0,0 +1,58 @@
cc.Class({
extends: cc.Component,
properties: {
userkuang: cc.Node,
erciTanchuang: cc.Node,
onButtonJieMian: cc.Node
},
start: function () {
if (window.qg || window.qq) {
this.jiance();
} else {
this.node.active = false;
}
},
jiance: function () {
var e = cc.sys.localStorage.getItem("user");
console.log("item" + e);
if (undefined == e || null == e || 0 == e.length) {
console.log("新用户");
this.node.getChildByName("item").active = true;
} else {
console.log("老用户");
this.node.getChildByName("item").active = false;
}
},
onShow: function () {
this.node.getChildByName("item").active = true;
this.onButtonJieMian.getChildByName("btn_ty").active = false;
this.onButtonJieMian.getChildByName("btn_bty").active = false;
this.onButtonJieMian.getChildByName("btn_Close").active = true;
},
onBtnClickEvent: function (e) {
var o = e.target.name;
console.log("点击了");
switch (o) {
case "btn_ty":
cc.sys.localStorage.setItem("user", 1);
this.node.getChildByName("item").active = false;
break;
case "btn_bty2":
cc.game.end();
this.node.getChildByName("item").active = false;
break;
case "btn_bty":
if (window.qq) {
qq.exitMiniProgram();
} else {
this.erciTanchuang.active = true;
}
break;
case "btn_Close":
this.node.getChildByName("item").active = false;
break;
case "btn_queding":
this.erciTanchuang.active = false;
}
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "c5860a74-167f-4936-b541-82779e3af3c8",
"isPlugin": false
}
+188
View File
@@ -0,0 +1,188 @@
function i(e, o) {
if (!(e instanceof o)) {
throw new TypeError("Cannot call a class as a function");
}
}
function n(e, o) {
for (var t = 0; t < o.length; t++) {
var i = o[t];
i.enumerable = i.enumerable || false;
i.configurable = true;
"value" in i && (i.writable = true);
Object.defineProperty(e, i.key, i);
}
}
function a(e, o, t) {
o && n(e.prototype, o);
t && n(e, t);
return e;
}
var c = function () {
function e() {
i(this, e);
this.activateVoice = true;
this.activateMusic = true;
this.volume = 0;
this.activateMusic = true;
this.activateEffect = true;
this.volume = 0;
}
a(e, [{
key: "playMusic",
value: function (e) {
if (this.activateMusic) {
var o = cc.Utils.AssetMgr.getAudioByName(e);
this.SoundIndex = cc.audioEngine.playMusic(o, true);
}
}
}, {
key: "stopMusic",
value: function () {
this.SoundIndex = -1;
cc.audioEngine.stopMusic();
}
}, {
key: "playEffect",
value: function (e) {
if (this.activateEffect) {
var o = cc.Utils.AssetMgr.getAudioByName(e);
cc.audioEngine.playEffect(o, false);
}
}
}]);
return e;
}();
var s = function () {
function e() {
i(this, e);
}
a(e, [{
key: "randomArray",
value: function (e) {
e.sort(function (e, o) {
if (Math.random() > .5) {
return -1;
} else {
return 1;
}
});
}
}]);
return e;
}();
var l = function () {
function e() {
i(this, e);
}
a(e, [{
key: "getCountDays",
value: function () {
var e = new Date();
return Math.floor(e / 864e5);
}
}]);
return e;
}();
var r = function () {
function e() {
i(this, e);
}
a(e, [{
key: "getRandomNum",
value: function (e, o) {
var t = o - e;
var i = Math.random();
return e + Math.round(i * t);
}
}, {
key: "getTwoVectorDegree",
value: function (e, o) {
var t = o.x - e.x;
var i = o.y - e.y;
var n = Math.atan2(i, t);
return cc.misc.radiansToDegrees(n) - 90;
}
}, {
key: "getMoveVector",
value: function (e, o) {
var t = cc.misc.degreesToRadians(e);
var i = cc.v2();
i.x = -Math.sin(t) * o;
i.y = Math.cos(t) * o;
return i;
}
}]);
return e;
}();
var d = function () {
function e() {
i(this, e);
}
a(e, [{
key: "getSpriteFrameByName",
value: function (e) {
for (var o in cc.SpriteFrames) {
var t = cc.SpriteFrames[o];
if (t.name === e) {
return t;
}
}
return null;
}
}, {
key: "getAudioByName",
value: function (e) {
for (var o in cc.Audios) {
var t = cc.Audios[o];
if (e === t.name) {
return t;
}
}
return null;
}
}, {
key: "getPrefabByName",
value: function (e) {
for (var o in cc.Prefabs) {
var t = cc.Prefabs[o];
if (t.name === e) {
return t;
}
}
return null;
}
}, {
key: "showMessage",
value: function (e) {
cc.view.getVisibleSize();
var o = cc.instantiate(this.getPrefabByName("Message"));
var t = cc.v2(cc.view.getVisibleSize().width / 2, cc.view.getVisibleSize().height / 2);
o.position = t;
cc.director.getScene().addChild(o);
o.getComponent("Message").setMessage(e);
}
}, {
key: "generateCurrency",
value: function (e, o, t, i, n) {
for (var a = 0; a < t; a++) {
var c = cc.instantiate(this.getPrefabByName("CurrencyItem"));
e.addChild(c);
c.getComponent("CurrencyItem").setDisplayInformation(o, i, n);
}
}
}]);
return e;
}();
module.exports = {
SoundMgr: new c(),
StringMgr: new function e() {
i(this, e);
}(),
ArrayMgr: new s(),
TimeMgr: new l(),
MathMgr: new r(),
NumberMgr: new function e() {
i(this, e);
}(),
AssetMgr: new d()
};
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "32928f4d-f29f-43db-b579-95e9c431ac02",
"isPlugin": false
}
+17
View File
@@ -0,0 +1,17 @@
cc.Class({
extends: cc.Component,
properties: {},
start: function () {
cc.global.Source.onPlayBtnEffect("xiangji");
},
onClickShare: function () {
var e = this;
cc.PlatformTools.executeShareRecorderVideo(function () {
e.node.removeFromParent(true);
}, function () {});
},
onCloseBtn: function () {
null != TouTiaoTools && window.tt && TouTiaoTools.randomsharelp();
this.node.removeFromParent(true);
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "a2b63801-4501-44cc-bb91-8d2c935a33ba",
"isPlugin": false
}
+225
View File
@@ -0,0 +1,225 @@
function i(e, o) {
if (!(e instanceof o)) {
throw new TypeError("Cannot call a class as a function");
}
}
function n(e, o) {
for (var t = 0; t < o.length; t++) {
var i = o[t];
i.enumerable = i.enumerable || false;
i.configurable = true;
"value" in i && (i.writable = true);
Object.defineProperty(e, i.key, i);
}
}
function a(e, o, t) {
o && n(e.prototype, o);
t && n(e, t);
return e;
}
var c = function () {
function e() {
i(this, e);
this.SystemInformation = null;
this.BannerInstance = null;
this.VideoInstance = null;
this.VideoSuccessCallBack = null;
this.VideoFailureCallBack = null;
this.InterstitialInstance = null;
this.InterstitialTimer = null;
this.widthScreen = null;
this.heightScreen = null;
}
a(e, [{
key: "doInitialize",
value: function () {
this.ChaPingCishu = 0;
if (window.h5api) {
console.log("当前是H5");
window.H5box = false;
this.H5Web = true;
} else {
window.H5box = true;
this.H5Web = false;
console.log("当前是游戏盒");
}
if (!this.H5Web) {
gamebox.login({
success: function (e) {
e.code || console.log("登录失败!" + e.errMsg);
}
});
var e = gamebox.getSystemInfoSync();
console.log("获取设备信息 " + JSON.stringify(e));
if (e) {
this.widthScreen = e.screenWidth;
this.heightScreen = e.screenHeight;
}
this.GaiLv(window.GameConfig.randomkaiping) && this.executeShowAwardVideo(null, null);
}
}
}, {
key: "executeShowBanner",
value: function () {
var e = this;
if (!this.H5Web) {
this.BannerInstance = gamebox.createBannerAd({
style: {
left: this.widthScreen - .15 * this.widthScreen,
top: this.widthScreen + 100,
width: .5 * this.widthScreen,
height: .4 * this.widthScreen * .3
}
});
this.BannerInstance.onLoad(function () {
console.log("4399banner广告加载中...");
e.BannerInstance.show();
});
this.BannerInstance.onError(function (o) {
console.log("4399banner广告加载失败 " + JSON.stringify(o));
e.BannerInstance.offError();
e.BannerInstance.offLoad();
});
}
}
}, {
key: "executeHideBanner",
value: function () {
this.H5Web || null != this.BannerInstance && (this.BannerInstance.hide(), this.BannerInstance.destroy(), this.BannerInstance = null);
}
}, {
key: "Suijivideo",
value: function (e) {}
}, {
key: "GaiLv",
value: function (e) {
return 1 + Math.floor(100 * Math.random()) <= e;
}
}, {
key: "executeJieSuanChaPing",
value: function () {
if (!this.H5Web) {
var e = gamebox.createInterstitialAd();
e.onLoad(function () {
console.log("4399插屏广告加载中...");
e.show();
});
e.onError(function (o) {
console.log("4399插屏广告加载失败 " + JSON.stringify(o));
e.offError(function () {});
e.offLoad(function () {});
e.offClose(function () {});
e.destroy();
});
e.onClose(function () {
console.log("4399插屏广告关闭");
e.offError(function () {});
e.offLoad(function () {});
e.offClose(function () {});
e.destroy();
});
}
}
}, {
key: "executeShowInterstitial",
value: function () {}
}, {
key: "executeShowAwardVideo",
value: function (e, o) {
var t = this;
if (this.H5Web) {
this.showH5Video(e, o);
} else {
this.VideoSuccessCallBack = e;
this.VideoFailureCallBack = o;
var i = gamebox.createRewardedVideoAd();
i.onLoad(function () {
console.log("4399视频广告加载中...");
i.show();
});
i.onError(function (e) {
t.videoDisplayFailureCallBack();
console.log("4399视频广告加载失败 " + JSON.stringify(e));
i.offError(function () {});
i.offLoad(function () {});
i.offClose(function () {});
i.destroy();
});
i.onClose(function () {
console.log("4399视频广告关闭");
i.offError(function () {});
i.offLoad(function () {});
i.offClose(function () {});
i.destroy();
});
i.onCompleted(function () {
t.videoDisplaySuccessCallBack();
});
}
}
}, {
key: "showH5Video",
value: function (e, o) {
var t = this;
this.VideoSuccessCallBack = e;
this.VideoFailureCallBack = o;
window.h5api.canPlayAd(function (e) {
console.log("是否可播放广告", e.canPlayAd, "剩余次数", e.remain);
window.h5api.playAd(function (e) {
console.log("代码:" + e.code + ",消息:" + e.message);
if (1e4 === e.code) {
cc.director.pause();
console.log("开始播放");
} else if (10001 === e.code) {
console.log("播放结束");
cc.director.resume();
t.videoDisplaySuccessCallBack();
} else {
console.log("广告异常");
cc.director.resume();
t.videoDisplayFailureCallBack();
}
});
});
}
}, {
key: "videoDisplaySuccessCallBack",
value: function () {
if (null != this.VideoSuccessCallBack) {
this.VideoSuccessCallBack();
this.VideoSuccessCallBack = null;
}
}
}, {
key: "videoDisplayFailureCallBack",
value: function () {
if (null != this.VideoFailureCallBack) {
this.VideoFailureCallBack();
this.VideoFailureCallBack = null;
}
}
}, {
key: "executeRecorder",
value: function () {}
}, {
key: "stopRecorder",
value: function () {}
}, {
key: "executeShareRecorder",
value: function (e, o) {}
}, {
key: "executeShowPushBox",
value: function () {}
}, {
key: "isInstalledShortcut",
value: function () {}
}, {
key: "sendDesktopShortcut",
value: function () {}
}, {
key: "executeBlockAdShow",
value: function () {}
}]);
return e;
}();
module.exports = new c();
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "86320dc0-0367-471a-895f-2945b8687660",
"isPlugin": false
}
+203
View File
@@ -0,0 +1,203 @@
function i(e, o) {
if (!(e instanceof o)) {
throw new TypeError("Cannot call a class as a function");
}
}
function n(e, o) {
for (var t = 0; t < o.length; t++) {
var i = o[t];
i.enumerable = i.enumerable || false;
i.configurable = true;
"value" in i && (i.writable = true);
Object.defineProperty(e, i.key, i);
}
}
function a(e, o, t) {
o && n(e.prototype, o);
t && n(e, t);
return e;
}
var c = function () {
function e() {
i(this, e);
this.Banner = null;
this.Video = null;
}
a(e, [{
key: "doInitialize",
value: function () {
window.ServerConfigBd = null;
window.ServerConfigBd = window.GameConfig;
console.log("获取到的开关是" + JSON.stringify(window.ServerConfigBd));
setTimeout(function () {}, 1e3);
this.loadvideo();
}
}, {
key: "executeShowBanner",
value: function () {
window.ServerConfigBd.showHutui && this.loadbanner();
}
}, {
key: "showBanner",
value: function (e, o) {}
}, {
key: "destroyBanner",
value: function () {
this.Banner && (this.Banner.active = false);
}
}, {
key: "showMoreGames",
value: function () {}
}, {
key: "GaiLv",
value: function (e) {
return 1 + Math.floor(100 * Math.random()) <= e;
}
}, {
key: "Suijivideo",
value: function (e, o) {
var t = this;
console.log("触发Baidu随机视频1111:" + e);
if (this.GaiLv(e)) {
this.video_success = o;
this.video_failure = o;
cc.audioEngine.pauseAll();
this.Video.load().then(function () {
console.log("广告加载成功, 开始显示广告");
t.Video.show().catch(function (e) {
t.Video.load().then(function () {
return t.Video.show();
});
});
}).catch(function (e) {
console.log("百度视频onload失败:", e);
cc.audioEngine.resumeAll();
});
} else {
console.log("=========概率不够");
}
}
}, {
key: "executeShowInterstitial",
value: function () {}
}, {
key: "executeRecorder",
value: function () {}
}, {
key: "stopRecorder",
value: function () {}
}, {
key: "executeShareRecorder",
value: function (e, o) {}
}, {
key: "executeShowPushBox",
value: function () {
window.ServerConfigBd.showHutui && this.loadbox();
}
}, {
key: "sendToDesktop",
value: function (e) {}
}, {
key: "executeShowAwardVideo",
value: function (e, o) {
var t = this;
if (new Date().getTime() - this.preClickTime <= 2e3) {
cc.Utils.AssetMgr.showMessage("广告加载中....");
} else {
console.log("触发Baidu激励视频");
this.video_success = e;
this.video_failure = o;
cc.audioEngine.pauseAll();
this.Video.load().then(function () {
console.log("广告加载成功, 开始显示广告");
t.Video.show().catch(function (e) {
t.Video.load().then(function () {
return t.Video.show();
});
});
}).catch(function (e) {
console.log("百度视频onload失败:", e);
cc.audioEngine.resumeAll();
});
}
}
}, {
key: "loadbox",
value: function () {
cc.loader.loadRes("Platform/Native/Prefab/gamePush_yu/gameList_push", function (e, o) {
if (e) {
console.log("载入预制资源失败, 原因:" + e);
} else if (o instanceof cc.Prefab) {
var t = cc.instantiate(o);
t.parent = cc.director.getScene();
t.zIndex = 9e3;
t.name = "gameList_push";
} else {
console.log("你载入的不是预制资源!");
}
}.bind(this));
}
}, {
key: "loadbanner",
value: function () {
cc.loader.loadRes("Platform/Native/Prefab/gamePush_yu/gameList_banner", function (e, o) {
if (e) {
console.log("载入预制资源失败, 原因:" + e);
} else if (o instanceof cc.Prefab) {
var t = cc.instantiate(o);
t.parent = cc.director.getScene();
t.zIndex = 9999;
t.name = "gameList_banner";
} else {
console.log("你载入的不是预制资源!");
}
}.bind(this));
}
}, {
key: "loadvideo",
value: function () {
var e = this;
this.Video = window.swan.createRewardedVideoAd({
adUnitId: "7690329",
appSid: "c33a7cf1"
});
this.Video.onClose(function (o) {
if (o.isEnded) {
console.log("激励视频完整播放后关闭");
cc.audioEngine.resumeAll();
e.video_success && e.video_success();
} else if (window.ServerConfigBd.showModal) {
window.swan.showModal({
title: "未观看完视频",
content: "观看完视频才能获得奖励哦",
success: function (o) {
if (o.confirm) {
e.Video.show().then(function () {
console.log("激励视频 广告显示");
}).catch(function () {
e.Video.load().then(function () {
return e.Video.show();
}).catch(function (e) {
console.log("激励视频 广告显示失败");
});
});
} else if (o.cancel) {
cc.audioEngine.resumeAll(), e.video_failure && e.video_failure();
}
},
fail: function (o) {
cc.audioEngine.resumeAll();
e.video_failure && e.video_failure();
}
});
} else {
console.log("激励视频中途被关闭");
cc.audioEngine.resumeAll();
e.video_failure && e.video_failure();
}
});
}
}]);
return e;
}();
module.exports = new c();
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "82f52b35-626f-4f80-b5f1-d5aae90d69be",
"isPlugin": false
}
+36
View File
@@ -0,0 +1,36 @@
cc.Class({
extends: cc.Component,
properties: {
startType: {
default: false,
displayName: "初始状态"
},
startTime: {
default: 0,
displayName: "起始延迟时间"
},
returnDelayTime: {
default: -1,
displayName: "返回延迟的时间,负数为不返回"
},
eventNode_over: {
default: null,
type: cc.Node,
displayName: "结束事件节点"
}
},
start: function () {
this.node.switchEvent = this.switchEvent.bind(this);
this.node.active = this.startType;
},
switchEvent: function () {
var e = this;
cc.tween(this.node).delay(this.startTime).call(function () {
console.log("状态:" + !e.node.active);
e.node.active = !e.node.active;
e.eventNode_over && e.eventNode_over.switchEvent();
}).start();
},
returnStartPos: function () {},
restoreEvent: function () {}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "8767053b-6c34-45ac-8074-b8150e5fb484",
"isPlugin": false
}
+49
View File
@@ -0,0 +1,49 @@
cc.Class({
extends: cc.Component,
properties: {
clcicknode: {
default: null,
type: cc.Node,
displayName: "点击的节点"
},
startTime: {
default: 0,
displayName: "起始延迟时间"
},
returnDelayTime: {
default: -1,
displayName: "返回延迟的时间,负数为不返回"
},
eventNode_over: {
default: null,
type: cc.Node,
displayName: "结束事件节点"
},
hideNode: {
type: cc.Node,
default: [],
displayName: "需要隐藏的节点"
}
},
start: function () {
this.clcicknode.on(cc.Node.EventType.TOUCH_END, this.switchEvent, this);
this.canClike = true;
},
switchEvent: function () {
var e = this;
if (this.canClike) {
this.node.parent.parent.getChildByName("hand_zhiyin") && 1 == this.node.parent.parent.getChildByName("hand_zhiyin").active && (this.node.parent.parent.getChildByName("hand_zhiyin").active = false);
if (this.hideNode) {
for (var o = 0; o < this.hideNode.length; o++) {
this.hideNode[o].active = false;
}
}
cc.tween(this.clcicknode).delay(this.startTime).call(function () {
e.canClike = false;
e.eventNode_over && e.eventNode_over.switchEvent();
}).start();
}
},
returnStartPos: function () {},
restoreEvent: function () {}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "b75893fa-5aca-496a-9872-911c37588a41",
"isPlugin": false
}
+52
View File
@@ -0,0 +1,52 @@
cc.Class({
extends: cc.Component,
properties: {
clcicknode: {
default: null,
type: cc.Node,
displayName: "点击的节点"
},
startTime: {
default: 0,
displayName: "起始延迟时间"
},
returnDelayTime: {
default: -1,
displayName: "返回延迟的时间,负数为不返回"
},
eventNode_over: {
default: null,
type: cc.Node,
displayName: "结束事件节点"
},
hideNode: {
type: cc.Node,
default: [],
displayName: "需要隐藏的节点"
}
},
start: function () {
this.clcicknode.on(cc.Node.EventType.TOUCH_START, this.switchEvent2, this);
this.canClike = true;
},
switchEvent2: function () {
var e = this;
if (this.canClike) {
console.log("点击了");
if (this.hideNode) {
for (var o = 0; o < this.hideNode.length; o++) {
this.hideNode[o].active = false;
}
}
cc.tween(this.clcicknode).delay(this.startTime).call(function () {
e.canClike = false;
if (e.eventNode_over) {
console.log("结束");
e.eventNode_over.switchEvent();
}
}).start();
}
},
returnStartPos: function () {},
restoreEvent: function () {}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "0a0e8b35-f47f-4db9-ab97-33ae611864b7",
"isPlugin": false
}
+70
View File
@@ -0,0 +1,70 @@
var i;
function n(e, o, t) {
if (o in e) {
Object.defineProperty(e, o, {
value: t,
enumerable: true,
configurable: true,
writable: true
});
} else {
e[o] = t;
}
return e;
}
window.GameConfig = (n(i = {
open1fz: false,
closeBtnScale: 1,
sendDesk: false,
quitShow: 0,
showChapingCiShu: 0,
openBox: 0,
randomSplshvideo: 0,
randomShowvideo: 0,
showbanner: false,
showChaping: false,
showhand: false,
isLine: false,
startVideo: false,
allowBanner: false,
randomVideo: 0,
allowInterstitial: false,
randomShare: 0,
faultBanner: 0,
randomPush: 0,
showModal: false,
randomCheckBox: 0,
bannerShowTime: 0,
tryPush: 0,
locationList: [],
showHutui: false,
TouShiLevel: false,
closebtnYC: false,
SceneID: [],
kaiping: 0,
winVideo: 0,
showBlock: false,
randomkaiping: 0,
randomLoadCaiQian: 0,
showguanzhu: false,
ShowPopCp: 0,
randomChaping: 0,
ShowInGameCp: 0,
randomSendDesk: 0,
ShowJieSuanCp: 0,
quitshow: 0
}, "showModal", false), n(i, "ShowTuiSongCiShu", 0), n(i, "Time180sAD", false), n(i, "levelOrder", [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]), i);
window.GamePingBi = {
TouShiLevelNode: [1, 4, 8, 11, 16, 23, 24, 29, 30]
};
window.GameConfig.iconList = [];
window.GameConfig.packageList = [];
window.GameConfig.gameName = [];
window.loadRemoteConfigInformation = function (e) {
e && e();
};
window.myLocation = "";
window.getMyLocation = function (e) {
console.log("读取位置信息.....");
window.loadRemoteConfigInformation(e);
};
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "2428e974-1323-414a-adef-0217946aa407",
"isPlugin": false
}
+90
View File
@@ -0,0 +1,90 @@
var i = cc.Enum({
xunhuan: 1,
zhengchang: 0
});
cc.Class({
extends: cc.Component,
properties: {
Soldier: {
default: null,
type: sp.Skeleton,
displayName: "动画"
},
startTime: {
default: 0,
displayName: "起始延迟时间"
},
endTime: {
default: 0,
displayName: "结束延迟时间"
},
huanyuanTime: {
default: 1e3,
displayName: "还原时间"
},
aniName: {
default: "",
displayName: "要播放的动画名字"
},
aniNameHuanyuan: {
default: "",
displayName: "要还原的动画名字"
},
ainCishu: {
type: cc.Enum(i),
default: i.xunhuan,
displayName: "动画播放次数"
},
hideNode: {
type: cc.Node,
default: [],
displayName: "需要隐藏的节点"
},
showNode: {
type: cc.Node,
default: [],
displayName: "需要显示的节点"
},
eventNode_over: {
default: [],
type: cc.Node,
displayName: "需要合并的事件节点"
},
SkinName: {
default: "",
displayName: "要修改的皮肤名称"
}
},
start: function () {
this.node.switchEvent = this.switchEvent.bind(this);
this.xunhuan = true;
0 == this.ainCishu && (this.xunhuan = false);
},
switchEvent: function () {
var e = this;
console.log("播放动画");
cc.tween(this.node).delay(this.startTime).call(function () {
e.SkinName && e.Soldier.setSkin(e.SkinName);
e.Soldier && e.aniName && e.Soldier.setAnimation(0, e.aniName, e.xunhuan);
e.Soldier && e.aniNameHuanyuan && setTimeout(function () {
console.log("播放动画==================");
e.Soldier.setAnimation(0, e.aniNameHuanyuan, true);
}, e.huanyuanTime);
setTimeout(function () {
if (e.hideNode) {
for (var o = 0; o < e.hideNode.length; o++) {
e.hideNode[o].active = false;
}
}
if (e.showNode) {
for (var t = 0; t < e.showNode.length; t++) {
e.showNode[t].active = true;
}
}
for (var i = 0; i < e.eventNode_over.length; i++) {
e.eventNode_over[i] && e.eventNode_over[i].switchEvent();
}
}, e.endTime);
}).start();
}
});
@@ -0,0 +1,4 @@
{
"uuid": "cb5dee70-6184-46b2-9163-50d236facab9",
"isPlugin": false
}
+47
View File
@@ -0,0 +1,47 @@
cc.Class({
extends: cc.Component,
properties: {
needMergeEventNodes: {
default: [],
type: cc.Node,
displayName: "需要合并的事件节点"
},
startDelayTime: {
default: 0,
displayName: "起始延迟的时间"
},
isAutomatic: {
default: false,
displayName: "是否自动触发"
},
yinyue: {
default: "",
displayName: "播放的声音名"
},
soundTime: {
default: 0,
displayName: "声音起始延迟的时间"
}
},
onLoad: function () {
this.node.switchEvent = this.switchEvent.bind(this);
},
start: function () {
1 == this.isAutomatic && this.switchEvent();
},
switchEvent: function () {
var e = this;
setTimeout(function () {
if (e.yinyue) {
cc.global.Source.onStopBjM();
cc.global.Source.onPlayBtnEffect(e.yinyue);
}
}, this.soundTime);
this.node.stopAllActions();
cc.tween(this.node).delay(this.startDelayTime).call(function () {
for (var o = 0; o < e.needMergeEventNodes.length; o++) {
e.needMergeEventNodes[o] && e.needMergeEventNodes[o].switchEvent();
}
}).start();
}
});
@@ -0,0 +1,4 @@
{
"uuid": "3e62401d-89da-4c91-8dcd-c0c1b87b7fb8",
"isPlugin": false
}
+47
View File
@@ -0,0 +1,47 @@
cc.Class({
extends: cc.Component,
properties: {
startDelayTime: {
default: 700,
displayName: "起始延迟的时间"
},
hideNode: {
type: cc.Node,
default: [],
displayName: "失败后需要隐藏的节点"
},
hideTime: {
default: 0,
displayName: "隐藏延迟的时间"
}
},
onLoad: function () {
this.isGameFail = false;
this.node.switchEvent = this.switchEvent.bind(this);
},
start: function () {},
switchEvent: function () {
var e = this;
if (1 != this.isGameFail) {
console.log("走到这里");
this.isGameFail = true;
this.node.stopAllActions();
setTimeout(function () {
if (e.hideNode) {
for (var o = 0; o < e.hideNode.length; o++) {
e.hideNode[o].active = false;
}
}
}, this.hideTime);
setTimeout(function () {
cc.global.LoadPreFtabData("prefab/ui/ui_lostGame", function () {}.bind(e));
}, this.startDelayTime);
}
},
setShootState: function () {
this.guang.active = true;
this.guang.runAction(cc.sequence(cc.fadeTo(.1, 255), cc.fadeTo(.2, 0), cc.callFunc(function () {
this.guang.active = false;
}.bind(this))));
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "14d14ae4-0370-4c9e-94ca-ef9b7fdb974b",
"isPlugin": false
}
+243
View File
@@ -0,0 +1,243 @@
cc.Class({
extends: cc.Component,
properties: {
Progress: {
default: null,
type: cc.ProgressBar
},
ProgressText: {
default: null,
type: cc.Label
},
showText: {
default: null,
type: cc.Label
}
},
onLoad: function () {
this.Progress.progress = 0;
this.lodeNum = 0;
window.GameLoad = this;
this.needLoadNum = 5;
window.uc && (GlobData.isUcMiNiGame = true);
},
start: function () {
if (cc.sys.platform == cc.sys.VIVO_GAME) {
window.GameConfig.ShowTuiSongCiShu = window.ShowTuiSongCiShu;
window.GameConfig.closebtnYC = window.closebtnYC;
window.GameConfig.showhand = window.showhand;
this.executeLoadSubpackage();
} else {
window.getMyLocation(this.executeLoadSubpackage.bind(this));
}
GlobData.doInitialize();
},
onLoadScene: function () {
console.log("开始加载场景");
cc.director.preloadScene("GameMain", function (e, o, t) {
this.Progress.progress = e / o;
this.ProgressText.string = Math.round(e / o * 100 * 10) / 10 + "%";
}.bind(this), function () {
console.log("home场景加载完成");
cc.loader.onProgress = null;
this.onToGame();
}.bind(this));
},
onLoadScene_game: function () {
cc.director.preloadScene("GameScene", function (e, o, t) {
this.Progress.progress = e / o;
this.ProgressText.string = Math.round(e / o * 100 * 10) / 10 + "%";
}.bind(this), function () {
console.log("game场景加载完成");
cc.loader.onProgress = null;
this.onToGame();
}.bind(this));
},
onToGame: function () {
this.lodeNum++;
console.log("onToGame:", this.lodeNum);
if (this.lodeNum >= this.needLoadNum) {
cc.global.isOneShowHome = false;
cc.director.loadScene("GameMain");
cc.global.isShowMaincishu = 0;
}
},
onLoadFunClass: function () {
cc.Numerical = require("Numerical");
cc.Utils = require("Utils");
new (require("GlobalVariable"))().init();
cc.global.Source = new (require("AudioSourceScript"))();
cc.global.Source.init();
cc.systemEvent.setAccelerometerEnabled(true);
var o = cc.director.getScene().getChildByName("zhiyinNode");
cc.game.addPersistRootNode(o);
cc.global.zhiyinNode = o.getComponent("GuoChangScript");
o.zIndex = 11;
var t = cc.director.getScene().getChildByName("hintWindow");
cc.game.addPersistRootNode(t);
t.zIndex = 11;
cc.global.hintText = t.getComponent("HintWindowScript");
var i = cc.director.getScene().getChildByName("loadingWindow");
cc.game.addPersistRootNode(i);
i.zIndex = 10;
cc.global.loadingWindow = i;
console.log("功能类载入完成");
this.onToGame();
},
loadAudioPath: function () {
cc.Audios = {};
cc.loader.loadResDir("game1/textures/sounds/", function (e, o, t) {}.bind(this), function (e, o) {
if (null == e) {
o.forEach(function (e) {
cc.Audios[e.name] = e;
});
} else {
console.error("声音加载出错", e);
}
console.log("声音全部载入完成");
this.onToGame();
}.bind(this));
},
getLocalStorage: function () {
if (cc.sys.localStorage.getItem("gameId_hhds")) {
console.log("不需要初始化存储");
cc.global.isGuidance = false;
} else {
console.log("需要初始化存储");
cc.sys.localStorage.clear();
cc.sys.localStorage.setItem("gameId_hhds", "true");
cc.global.isGuidance = true;
}
cc.global.Source.init();
if (s = cc.sys.localStorage.getItem("lastOnLineTime")) {
cc.global.lastOnLineTime = parseInt(s);
} else {
cc.sys.localStorage.setItem("lastOnLineTime", JSON.stringify(cc.global.lastOnLineTime));
}
var e = cc.sys.localStorage.getItem("signInfo");
if (e) {
cc.global.signInfo = JSON.parse(e);
} else {
cc.sys.localStorage.setItem("signInfo", JSON.stringify(cc.global.signInfo));
}
var o = this.onGetTimeInfo(cc.global.lastOnLineTime);
var t = o.isSameWeek;
var i = o.isSameDay;
o.intervalTime;
var n = cc.global.signInfo.days;
var a = cc.global.signInfo.allow;
this.isReset = false;
if (1 == t) {
if (!(1 == i)) {
a = true, this.isReset = true;
}
} else {
n = 0;
a = true;
this.isReset = true;
}
var c = {
days: n,
allow: a
};
cc.global.signInfo = c;
cc.sys.localStorage.setItem("signInfo", JSON.stringify(cc.global.signInfo));
if (1 == this.isReset) {
cc.global.power = 10;
cc.sys.localStorage.setItem("power", JSON.stringify(cc.global.power));
}
var s = new Date().getTime();
cc.sys.localStorage.setItem("lastOnLineTime", JSON.stringify(s));
this.onToGame();
},
onGetTimeInfo: function (e) {
e > 0 || (e = parseInt(e));
var o = new Date().getTime();
var t = new Date(e);
var i = new Date(o);
var n = t.getDay();
var a = i.getDay();
0 == a && (a = 7);
0 == n && (n = 7);
var c = false;
var s = false;
var l = parseInt((o - e) / 1e3);
if (n < a) {
o - e < 6048e5 && (c = true);
} else if (n == a && o - e < 864e5) {
c = true, s = true;
}
return {
isSameWeek: c,
isSameDay: s,
intervalTime: l
};
},
executeLoadSubpackage: function () {
console.log("开始加载分包");
var e = null;
if (e = window.swan ? window.swan : window.qq ? window.qq : window.tt ? window.tt : cc.sys.platform == cc.sys.OPPO_GAME ? window.qg : window.ks ? ks : null) {
e.showLoading({
title: "加载数据中,请稍等...",
mask: true,
success: function () {
return console.log("loading\xA0提示框显示成功");
}
});
var o = function (o, t) {
if ((console.log("当前加载分包包名:", o), window.ks) && !kwaigame.isSupport(kwaigame.Support.features.Subpackage)) {
window.require(o + "/main.js");
return void ("bao3" == o && t());
}
e.loadSubpackage({
name: o,
success: function (e) {
console.log("加载分包\xA0success");
t();
},
fail: function (o) {
console.log("加载分包\xA0fail");
if (window.ks) {
e.hideLoading();
ks.showToast({
title: "请检查网络连接是否正常",
icon: "none",
duration: 1e4
});
}
}
}).onProgressUpdate(function (e) {
console.log("下载进度", e.progress);
console.log("已经下载的数据长度", e.totalBytesWritten);
console.log("预期需要下载的数据总长度", e.totalBytesExpectedToWrite);
});
};
(function (e, t) {
var i = 0;
o(e[i], function n() {
if (++i >= e.length) {
t();
} else {
o(e[i], n);
}
});
})(["bao1", "bao2", "bao3", "bao4", "bao5"], function () {
e.hideLoading({});
this.startLoadApplication();
}.bind(this));
} else {
this.startLoadApplication();
}
},
startLoadApplication: function () {
console.log("游戏配置:", window.GameConfig);
GlobData.onAndroidInit();
this.onLoadFunClass();
this.loadAudioPath();
this.getLocalStorage();
this.onLoadScene();
this.onToGame();
var o = require("Platform");
cc.PlatformTools = new o();
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "f98c944a-26f8-4b72-8b48-06f10eb8b82f",
"isPlugin": false
}
+65
View File
@@ -0,0 +1,65 @@
cc.Class({
extends: cc.Component,
properties: {
qiandaoPrefab: cc.Prefab
},
onLoad: function () {
cc.global.MianScript = this;
this.game = "game1";
},
start: function () {
if (cc.sys.platform == cc.sys.VIVO_GAME) {
undefined != window.vivoUtil && vivoUtil.showMoreGame();
} else {
cc.PlatformTools.executeShowBanner();
}
window.uc || cc.PlatformTools.executeShowInterstitial();
cc.PlatformTools.executeBlockAdShow();
cc.global.signInfo.allow && cc.global.isOneShowHome && this.OnQianDaoUi();
cc.global.isOneShowHome;
cc.global.isOneShowHome || (cc.global.isOneShowHome = true);
cc.global.Source.onPlayBjM("bj1");
},
onDestroy: function () {
window.vivoUtil && vivoUtil.closeBoxPortalAd();
cc.PlatformTools.executeHideBanner();
},
oonBtnClickEvent: function (e) {
var o = this;
cc.global.Source.onPlayBtnEffect("buttonClick");
switch (e.target.name) {
case "Startbtn":
cc.global.zhiyinNode.showZhuanchang(function () {
cc.global.LoadPreFtabData("".concat(o.game, "/prefab/gameui/").concat(o.game, "_xuanguan"), function () {}.bind(o));
});
break;
case "Startbtn2":
this.game = "game1";
console.log("this.game" + this.game);
cc.global.zhiyinNode.showZhuanchang(function () {
cc.global.LoadPreFtabData("".concat(o.game, "/prefab/gameui/").concat(o.game, "_xuanguan"), function () {}.bind(o));
});
break;
case "qdbtn":
this.OnQianDaoUi();
break;
case "shangdian_ske":
cc.global.LoadPreFtabData("".concat(this.game, "/shop/shopUI"), function () {}.bind(this));
}
},
showTuiSong: function (e) {
var o = arguments.length > 1 && undefined !== arguments[1] ? arguments[1] : null;
cc.loader.loadRes("prefab/ui/pushCoins_UI", function (t, i) {
if (!t && i instanceof cc.Prefab) {
var n = cc.instantiate(i);
n.parent = cc.director.getScene();
n.position = cc.v2(0, 0);
n.zIndex = 9999;
n.getComponent("pushWindow").show(e, o);
}
}.bind(this));
},
OnQianDaoUi: function () {
cc.instantiate(this.qiandaoPrefab).parent = cc.director.getScene();
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "ec219fbc-1c7c-4b8b-9bbb-b98ade582ad2",
"isPlugin": false
}
+11
View File
@@ -0,0 +1,11 @@
cc.Class({
extends: cc.Component,
properties: {},
start: function () {
cc.sys.platform != cc.sys.OPPO_GAME && (this.node.active = false);
(window.qq || window.tt || GlobData.is4399MiNiGame) && (this.node.active = true);
},
onBtnClick: function () {
cc.PlatformTools.executeShowPushBox();
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "85ccbdcc-7b3f-4253-80cf-575c2c744227",
"isPlugin": false
}
+23
View File
@@ -0,0 +1,23 @@
cc.Class({
extends: cc.Component,
properties: {},
start: function () {
this.game = "game1";
cc.PlatformTools.executeShowBanner();
cc.PlatformTools.executeShowInterstitial();
},
onClickBtnEvent: function (e) {
cc.global.Source.onPlayBtnEffect("buttonClick");
switch (e.target.name) {
case "btnts_video":
var o = this;
cc.PlatformTools.executeShowAwardVideo(function () {
o.node.removeFromParent(true);
cc.global.LoadPreFtabData("".concat(o.game, "/prefab/gameui/").concat(o.game, "_TiShi"), function () {}.bind(this));
}, function () {});
break;
case "btn_guanbi":
GlobData.GameBtnClose(this.node, false);
}
}
});
+4
View File
@@ -0,0 +1,4 @@
{
"uuid": "96aac57d-1f04-4695-9ad8-b3fe943d5ee8",
"isPlugin": false
}

Some files were not shown because too many files have changed in this diff Show More