Commit 444faf7b authored by 范雪寒's avatar 范雪寒

feat:

parent d4c5cd1b
No preview for this file type
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"uuid": "d3ad24ed-9c8b-421d-934f-f93f1acf3060",
"isBundle": false,
"bundleName": "",
"priority": 1,
......
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "24330de0-b7cd-43f1-beb7-b8067687e658",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.2.9",
"uuid": "2ce7d58d-b6fe-4ef7-a128-de76f672a803",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "d52205af-491c-43a8-b313-07d2d8298171",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
const tools = require("../script/tools");
var onlyOne
cc.Class({
extends: cc.Component,
properties: {
quan: cc.Node,
tipsAnim: cc.Animation,
sprite: cc.Sprite,
db: dragonBones.ArmatureDisplay
},
data: null,
onLoad() {
this._playing = false
this.quan.active = false
this.tipsAnim.node.active = false
},
onEnable() {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
},
onDisable() {
this.node.off(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
},
initWithData(data, scale, xvalue, yvalue) {
this.data = data
let rect = this.data.rect
this.node.x = (rect.x + rect.width / 2) * scale + xvalue
this.node.y = (rect.y + rect.height / 2) * scale + yvalue
this.node.width = rect.width * scale
this.node.height = rect.height * scale
this.sprite.node.active = false
let comps = this.getComponentsInChildren(cc.Widget)
for (let one of comps) {
one.updateAlignment()
}
this.audioId = null
this._isComplent = false;
},
onTouchStart() {
if (g.data_mgr.nodPlayer) {
g.data_mgr.nodPlayer.onStopAudio();
}
if (this._playing) return
if (this.audioId) return
if (this.data) {
if (!this._isComplent) {
this.db.node.active = true;
this.playCatDragon();
g.game.inst.onBtnCheck();
//已经完成
this._isComplent = true;
}
if (this.data.pic_url && this.data.gIdx == 0) {
tools.getSpriteFrimeByUrl(this.data.pic_url, (sp) => {
this.sprite.spriteFrame = sp
this.sprite.node.width = this.node.width
this.sprite.node.height = this.node.height
this.sprite.node.active = true
})
}
this.quan.active = true
if (!this._playing) {
this._playing = true;
g.data_mgr.nodPlayer = this;
cc.systemEvent.once('stopMusic', this.onStopAudio, this)
// if (onlyOne != this) {
// this._playing = false
// return
// }
let url = this.data.audio_url
if (url && url != '') {
setTimeout(() => {
this.playAudio(url)
}, 500)
} else {
this._playing = false
}
}
// if (onlyOne && onlyOne != this) {
// onlyOne.hideBox()
// }
// onlyOne = this
}
},
//播放猫动画
playCatDragon() {
this.db.armatureName = "Armature";
this.db.playAnimation("newAnimation", 1);
},
onClickHide() {
this.sprite.node.active = false
this.hideBox()
},
/**隐藏边框 */
hideBox() {
this.quan.active = false
this.stopAudio()
},
/** 播放音乐 */
playAudio(url) {
cc.assetManager.loadRemote(url, (err, audioClip) => {
if (err) return
if (!this._playing) return
this.audioId = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setFinishCallback(this.audioId, this.stopAudio.bind(this));
this.tipsAnim.node.active = true
this.tipsAnim.play()
});
},
onStopAudio() {
this._playing = false
this.stopAudio()
},
stopAudio() {
g.data_mgr.nodPlayer = null;
this._playing = false
if (this.audioId != null) {
cc.audioEngine.stop(this.audioId)
this.audioId = null
}
this.tipsAnim.stop()
this.tipsAnim.node.active = false
cc.systemEvent.off('stopMusic', this.onStopAudio, this)
},
/** 音频id */
audioId: null,
});
{
"ver": "1.0.8",
"uuid": "f8b451ff-857c-4ca8-9870-866bc5154a29",
"uuid": "57f79280-6f4b-4d53-b1e3-1cca543a4d9e",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "39e69d6f-e00b-4664-9186-995a78d9238d",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
const tools = require("../script/tools");
var picNode = cc.Class({
extends: cc.Component,
properties: {
hitPre: cc.Prefab,
quan: cc.Node,
},
onLoad() {
},
ctor: function () {
picNode.inst = this;
g.picNode = picNode;
},
onEnable() {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
},
onDisable() {
this.node.off(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
},
onTouchStart() {
if (g.data_mgr.nodPlayer) {
g.data_mgr.nodPlayer.onStopAudio();
}
g.speaker.inst.playEffect(g.enum.E_Audio.Error);
},
onShow(data) {
this._hitItem = []
this._sprite = this.getComponentInChildren(cc.Sprite)
this._items = this.quan;
this.initWithData(data);
},
initWithData(data) {
this.clearItems()
tools.getSpriteFrimeByUrl(data.bgItem.url, (sp) => {
//设置图片
this._sprite.spriteFrame = sp
this.photoScare(this._sprite.node);
this._items.width = this.node.width
this._items.height = this.node.height
this._items.x = -this.node.width / 2
this._items.y = this.node.height / 2
if (this._items.height / data.bgItem.rect.height < this._items.width / data.bgItem.rect.width) {
var scale = this.node.height / data.bgItem.rect.height
//X不够补X偏移量
var Xvalue = (this.node.width - data.bgItem.rect.width * scale) / 2
var Yvalue = 0;
} else {
var scale = this.node.width / data.bgItem.rect.width
//Y不够补Y偏移量
var Xvalue = 0;
var Yvalue = (this.node.height - data.bgItem.rect.height * scale) / 2
}
//初始化点击区域
let node, comp
for (let data of data.hotZoneItemArr) {
node = cc.instantiate(this.hitPre)
comp = node.getComponent('hitItem')
comp.initWithData(data, scale, Xvalue, Yvalue);
this._items.addChild(node)
this._hitItem.push(node)
}
})
},
//图片适配
photoScare: function (node) {
var height = 580;
var width = 1012;
// var maxNum = type == 0 ? 50 : 280;
let maxSize = Math.min(height / node.height, width / node.width);
if (node.perScale == undefined) {
node.perScale = node.scaleX;
} else {
node.scaleX = node.perScale;
node.scaleY = node.perScale;
}
node.scaleX *= maxSize;
node.scaleY *= maxSize;
this.maxSize = maxSize;
},
/** 清除item */
clearItems() {
this._items.removeAllChildren(true)
this._hitItem.length = 0
}
});
{
"ver": "1.0.8",
"uuid": "c41b0e51-55d7-443c-af3a-b22c3dd9b9e5",
"uuid": "62989d72-21cb-4b26-a323-fce556c9e3c4",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
const tools = {
getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
if (cb) {
cb(spriteFrame);
}
})
}
}
module.exports = tools
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "ade7af40-d56d-4087-bbc6-2888fef55353",
"uuid": "68947d90-e044-48ff-8bce-670db8633681",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "e1f95314-d217-4a8a-9baf-245d0533c9a8",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "e11a7c61-701d-41bd-b74b-dbac7efd3a7e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 366,
"height": 336,
"width": 351,
"height": 93,
"platformSettings": {},
"subMetas": {
"1orange": {
"bg_bottom": {
"ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"uuid": "c260e7d3-9aa7-46ca-99f5-7ca5f31f7fef",
"rawTextureUuid": "e11a7c61-701d-41bd-b74b-dbac7efd3a7e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"offsetY": 0,
"trimX": 0,
"trimY": 1,
"width": 366,
"height": 335,
"rawWidth": 366,
"rawHeight": 336,
"trimY": 0,
"width": 351,
"height": 93,
"rawWidth": 351,
"rawHeight": 93,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "82ae3bc3-8bdf-463b-97d1-60ebd190bad2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 170,
"height": 100,
"platformSettings": {},
"subMetas": {
"bg_quan": {
"ver": "1.0.4",
"uuid": "9b336882-962e-447b-9d2c-89aca2bf95b4",
"rawTextureUuid": "82ae3bc3-8bdf-463b-97d1-60ebd190bad2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 170,
"height": 100,
"rawWidth": 170,
"rawHeight": 100,
"borderTop": 31,
"borderBottom": 31,
"borderLeft": 31,
"borderRight": 31,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "617acbce-eb22-416b-b5d5-f1eaf7187ca9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 34,
"height": 34,
"platformSettings": {},
"subMetas": {
"btn_x": {
"ver": "1.0.4",
"uuid": "b7316664-aba4-4008-a54a-11908a6c0b15",
"rawTextureUuid": "617acbce-eb22-416b-b5d5-f1eaf7187ca9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 34,
"height": 34,
"rawWidth": 34,
"rawHeight": 34,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "eacc8e5b-ced0-41c7-a1de-70fb0645bf60",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 49,
"height": 49,
"platformSettings": {},
"subMetas": {
"icon_dian": {
"ver": "1.0.4",
"uuid": "5daba96f-eff5-4bee-9ba9-d67c0134212a",
"rawTextureUuid": "eacc8e5b-ced0-41c7-a1de-70fb0645bf60",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 49,
"height": 49,
"rawWidth": 49,
"rawHeight": 49,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ed5b81e2-ee7b-4f76-b424-9df340e5f298",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 69,
"height": 78,
"platformSettings": {},
"subMetas": {
"icon_hand": {
"ver": "1.0.4",
"uuid": "562deefd-c9fd-42f0-97d7-d6f5893ef3f3",
"rawTextureUuid": "ed5b81e2-ee7b-4f76-b424-9df340e5f298",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 69,
"height": 78,
"rawWidth": 69,
"rawHeight": 78,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "1d277eb9-4061-4e88-9905-dfc6cf68a672",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 144,
"width": 69,
"height": 78,
"platformSettings": {},
"subMetas": {
"icon": {
"icon_hand2": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"uuid": "61e47c68-658d-416b-a46e-399ebfddd2c8",
"rawTextureUuid": "1d277eb9-4061-4e88-9905-dfc6cf68a672",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"offsetY": -1,
"trimX": 0,
"trimY": 2,
"width": 138,
"height": 141,
"rawWidth": 144,
"rawHeight": 144,
"width": 69,
"height": 76,
"rawWidth": 69,
"rawHeight": 78,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"uuid": "b3254bf5-7afe-4d42-8815-9693edf14d81",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 61,
"width": 46,
"height": 67,
"platformSettings": {},
"subMetas": {
"btn_left": {
"icon_tips": {
"ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"uuid": "b41667f5-0e09-49f6-b7e8-19b88dc8ea8b",
"rawTextureUuid": "b3254bf5-7afe-4d42-8815-9693edf14d81",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......@@ -22,9 +22,9 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 61,
"width": 46,
"height": 67,
"rawWidth": 61,
"rawWidth": 46,
"rawHeight": 67,
"borderTop": 0,
"borderBottom": 0,
......
{
"__type__": "cc.AnimationClip",
"_name": "tips",
"_objFlags": 0,
"_native": "",
"_duration": 0.5,
"sample": 40,
"speed": 1,
"wrapMode": 2,
"curveData": {
"props": {
"opacity": [
{
"frame": 0,
"value": 255,
"curve": "cubicIn"
},
{
"frame": 0.25,
"value": 0,
"curve": "cubicIn"
},
{
"frame": 0.5,
"value": 255
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "a6b7da30-d79b-4854-9182-3c973cef9e5e",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "e5510638-fc47-4bba-a7ed-e8b70cd74cd4",
"downloadMode": 0,
"duration": 1.776327,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b",
"uuid": "1e632c07-6c31-404b-8a45-ff1f55c236eb",
"downloadMode": 0,
"duration": 0.130612,
"subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "5fc68702-8884-47b7-a1f4-e4c3e05053cb",
"downloadMode": 0,
"duration": 4.04898,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "7e550adf-98ad-4a4e-a238-725aca313c49",
"downloadMode": 0,
"duration": 0.470204,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "de5a7da8-a6b4-414b-9143-2f00b90d4d7e",
"downloadMode": 0,
"duration": 0.264,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "721842df-3ed0-4638-9601-884f3c385865",
"downloadMode": 0,
"duration": 2.115917,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "5317ff9d-23a3-4bb2-bba8-53b5321b553b",
"subMetas": {}
}
\ No newline at end of file
{"name":"right","imagePath":"right_tex.png","SubTexture":[{"name":"1/圆","x":1,"height":98,"y":1,"width":98},{"name":"1/星1","x":66,"height":59,"y":172,"width":57},{"name":"1/星2","x":71,"height":45,"y":101,"width":43},{"name":"1/星3","x":1,"height":64,"y":172,"width":63},{"name":"1/星4","x":183,"height":45,"y":172,"width":45},{"name":"1/星6","x":1,"height":69,"y":101,"width":68},{"name":"1/星7","x":116,"height":40,"y":101,"width":37},{"name":"1/星5","x":125,"height":57,"y":172,"width":56},{"name":"1/星8","x":183,"height":33,"y":219,"width":32},{"name":"1/星9","x":155,"height":37,"y":101,"width":36}],"height":256,"width":256}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "ae34c776-2b35-437c-92f2-9c87edd10dcb",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ec38e850-44bb-4052-9453-bb4c65bb0afe",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 256,
"platformSettings": {},
"subMetas": {
"right_tex": {
"ver": "1.0.4",
"uuid": "204b1483-d215-4577-bd52-56d30e0ae17c",
"rawTextureUuid": "ec38e850-44bb-4052-9453-bb4c65bb0afe",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -13.5,
"offsetY": 1.5,
"trimX": 1,
"trimY": 1,
"width": 227,
"height": 251,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "bf718d00-23b5-4393-8285-ef7a241b9afa",
"subMetas": {}
}
\ No newline at end of file
{"name":"正确效果","SubTexture":[{"name":"1/勾","x":1,"height":112,"y":1,"width":128},{"name":"1/星1","x":196,"height":59,"y":72,"width":57},{"name":"1/星2","x":1,"height":45,"y":192,"width":43},{"name":"1/星3","x":131,"height":64,"y":72,"width":63},{"name":"1/星4","x":201,"height":45,"y":1,"width":45},{"name":"1/星6","x":131,"height":69,"y":1,"width":68},{"name":"1/星7","x":1,"height":40,"y":115,"width":37},{"name":"1/星5","x":196,"height":57,"y":133,"width":56},{"name":"1/星8","x":78,"height":33,"y":115,"width":32},{"name":"1/星9","x":40,"height":37,"y":115,"width":36}],"imagePath":"正确效果_tex.png","height":256,"width":256}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "2a1c4975-20c7-425f-a159-537a0e44fbcb",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ff0f9fe1-277f-4d06-9a86-2b838f49e899",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 256,
"platformSettings": {},
"subMetas": {
"正确效果_tex": {
"ver": "1.0.4",
"uuid": "ef344e8b-5ff7-495c-8441-7891c9963a6f",
"rawTextureUuid": "ff0f9fe1-277f-4d06-9a86-2b838f49e899",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 9,
"trimX": 1,
"trimY": 1,
"width": 252,
"height": 236,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "455577d8-9fe9-451b-8bb0-241ffe3d08ef",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "2.1.0",
"uuid": "ac5cd74f-7311-4fae-a586-f37a87e61455",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "2.1.0",
"uuid": "ce2d6cce-f4b4-4f14-b57c-f026dc181a88",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "da124b99-7f04-47cd-942e-a9f80f0b4f04",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "61fcc759-2eb5-4e50-a2f3-0cc3393881d8",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "4fe6019f-f84c-439f-97b8-a4cfe2ddc7ca",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "f0214b38-1b2a-41ef-aa3e-1d6949fd3b12",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "1fc51dd0-d295-4a33-8b99-adcb5978c932",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "5c0041d0-ccbd-4069-bc12-73a47695ed52",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "a777fdf7-eb0b-41df-b0f7-ada8ed99b97d",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.2.9",
"uuid": "c020c4aa-c261-4e24-ae6e-a564a5bb6865",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "8b78aa33-0eb9-4b52-ae1b-3abacd0ee4f2",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.2.9",
"uuid": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3",
"uuid": "14c37636-02d3-4ff8-8d46-32898ddb9a11",
"asyncLoadAssets": false,
"autoReleaseAssets": true,
"subMetas": {}
......
/**
* 游戏主逻辑
*/
var game = cc.Class({
extends: cc.Component,
properties: {
btnRestart: {
default: null,
type: cc.Node,
displayName: "重开按钮"
}
},
ctor: function () {
game.inst = this;
g.game = game;
},
// 生命周期 onLoad
onLoad() {
//初始化游戏
this.initGame();
if (window.addEventListener) {
window.addEventListener('resize', this.scaleEventCallBack, false)
} else if (window.attachEvent) {
window.attachEvent('resize', this.scaleEventCallBack, false)
}
cc.debug.setDisplayStats(false);
},
//屏幕缩放
scaleEventCallBack: function () {
g.event_mgr.send("adjustUI");
},
//初始化游戏
initGame: function () {
//获得数据
g.res_mgr.getFormData();
},
onBtnTest() {
g.Light.inst.addLightNum(3);
},
onBtnTest2() {
g.Light.inst.showLight();
},
//检查当前缩放倍数
checkScale: function (num) {
var scale = 1;
if (num > 2 && num <= 4) {
scale = 0.74
}
if (num > 4) {
scale = 0.65
}
return scale;
},
//添加节点
addItem: function () {
let itemArr = g.data_mgr.getSheepArr();
this.idx = this.checkNodeParent();
g.data_mgr.nowNum = itemArr.length;
itemArr.sort(function () { return Math.random() > 0.5 ? -1 : 1; })
for (var i = 0; i < itemArr.length; i++) {
let newItem_0 = cc.instantiate(this.Item_0[itemArr.length > 14 ? 0 : 1]);
//更新子项
var com = newItem_0.getChildByName("item").getComponent("item");
let itemInfo = itemArr[i];
com.updateUI(itemInfo);
newItem_0.active = true;
//设置类别
let sheepInfo = g.data_mgr.getSheep(i);
newItem_0.getChildByName("item").type = this.checkType(sheepInfo.sheepfoldId);
newItem_0.parent = this.contentArr_2[this.idx];
};
},
//检测放到哪个节点底下
checkNodeParent: function () {
//获取到总列表
var itemArr = g.data_mgr.getSheepArr();
//
if (itemArr.length <= 7) {
this.contentArr_2[1].active = true;
var idx = 1;
} else {
this.contentArr_2[0].active = true;
var idx = 0;
}
return idx;
},
//检查类别
checkType: function (Id) {
for (var i in g.data_mgr.getSheepfoldArr()) {
var sheepfoldInfo = g.data_mgr.getSheepfoldArr()[i];
if (Id == sheepfoldInfo.id) {
return ~~i + 1;
}
}
return -1;
},
//设置目标节点类型
setOptionType: function () {
//设置类型
this.OptionType = g.data_mgr.getSheepfoldArr().length - 3;
},
getOptionType: function () {
return this.OptionType;
},
//更新界面信息
UpdataUi: function () {
this.btnRestart.active = false;
//设置题目长度
g.scoreStart.inst.addStar(g.data_mgr.data.starArr.length);
g.data_mgr.ansId = 0;
g.data_mgr.startId = 0;
//初始化单题题目
this.InitQuestion();
},
//初始化单个题目
InitQuestion() {
var question = g.data_mgr.data.starArr[g.data_mgr.startId].queArr[g.data_mgr.ansId]
//初始化灯
g.Light.inst.addLightNum(question.hotZoneItemArr.length);
//初始化标题
g.titleType.inst.showTitle(question.title, question.title_audio_url);
if (question.title_audio_url) {
g.data_mgr.gameState = 2;
setTimeout(() => {
g.titleType.inst.onBtnPlayEffect();
}, 500)
}
//设置中间图片
g.picNode.inst.onShow(question);
},
onBtnCheck() {
//默认答对
//播放特效
//灯+1
g.speaker.inst.playEffect(g.enum.E_Audio.Right);
let num = g.Light.inst.showLight();
if (num == -1) {
g.data_mgr.ansId += 1;
if (g.data_mgr.ansId >= g.data_mgr.data.starArr[g.data_mgr.startId].queArr.length) {
//大星星音效
g.speaker.inst.playEffect(g.enum.E_Audio.Star);
g.scoreStart.inst.showStar();
g.data_mgr.ansId = 0;
g.data_mgr.startId += 1;
}
setTimeout(() => {
if (g.data_mgr.startId >= g.data_mgr.data.starArr.length) {
g.speaker.inst.playEffect(g.enum.E_Audio.Flowers);
g.effect.inst.showEffect2();
this.btnRestart.active = true;
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
if (middleLayerComponent.role == 'student') {
middleLayerComponent.onHomeworkFinish(() => { });
}
} else {
console.log('onHomeworkFinish');
}
} else {
this.InitQuestion();
}
}, 1500)
}
},
//播放标题音效
playAudioTitle: function () {
//获得播放路径
var path = g.data_mgr.data.audio_url;
g.res_mgr.playAudioByUrl(path, (url) => {
g.snd_mgr.playEffect(url, null);
});
},
//重置UI界面
resetUI: function () {
//移除所有子节点
this.contentArr_2[0].removeAllChildren();
this.contentArr_2[1].removeAllChildren();
//移除所有子节点
g.event_mgr.send("reSetGame");
},
//重新开始
onBtnReStart: function () {
g.speaker.inst.playEffect(g.enum.E_Audio.BtnCommom);
//移除所有计时器
this.unscheduleAllCallbacks();
//初始化界面
this.UpdataUi();
},
//游戏开始
gameStart: function () {
console.log("游戏开始:" + g.data_mgr);
//播放一个上面的音乐
this.setAudioInfo(1);
},
checkAnswer(caller, option_i) {
if (caller == undefined) {
return;
}
if (option_i != -1) {
let nodOption = this.contType[this.OptionType].children[option_i - 1]
if (nodOption) {
let AABB = nodOption.getComponent("DragGameOptionObject").setAABB();
let callerAABB = this.getCallerAABB(caller);
var isIntersect = AABB.containsRect(callerAABB);//判断是否被包含
console.log(isIntersect)
if (isIntersect) {
return nodOption;
}
return false
}
}
},
getCallerAABB(caller) {
let svLeftBottomPoint = caller.parent.convertToWorldSpaceAR(
cc.v2(
caller.x,
caller.y
)
);
var posNode_1 = cc.rect(
svLeftBottomPoint.x,
svLeftBottomPoint.y,
0,
0
);
return posNode_1
},
onDestroy() {
window.g = null;
}
});
{
"ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5",
"uuid": "8b0b794c-7f5e-4e94-82b8-d1c85bc69eb8",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.1.2",
"uuid": "7488de23-e223-4a1c-9a61-a332a676694e",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment