Commit bb8de8e6 authored by 范雪寒's avatar 范雪寒

feat: 猫咪动作

parent fbcb2cb7
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "9096ad01-828a-45a8-8e37-b2d813b1ed37",
"subMetas": {}
}
\ No newline at end of file
{"name":"mao","imagePath":"mao_tex.png","SubTexture":[{"name":"猫01/影子","x":1,"height":66,"y":343,"width":337},{"name":"猫01/尾巴","x":1,"height":109,"y":188,"width":175},{"name":"猫01/右腿","x":178,"height":117,"y":188,"width":104},{"name":"猫01/左腿","x":1,"height":115,"y":569,"width":64},{"name":"猫01/右手","x":427,"height":122,"y":590,"width":69},{"name":"猫01/左手","x":301,"height":74,"y":590,"width":124},{"name":"猫01伸/左手伸直","x":299,"height":169,"y":1,"width":168},{"name":"猫01伸/右手伸直","x":299,"height":169,"y":172,"width":168},{"name":"猫01/身体","x":340,"height":180,"y":343,"width":122},{"name":"猫01/领带","x":1,"height":156,"y":411,"width":120},{"name":"猫01/右耳","x":155,"height":76,"y":602,"width":90},{"name":"猫01/左耳","x":67,"height":85,"y":602,"width":86},{"name":"猫01/组_1","x":1,"height":185,"y":1,"width":296},{"name":"猫01/右眼","x":1,"height":60,"y":686,"width":59},{"name":"猫01/右眉毛","x":67,"height":5,"y":595,"width":33},{"name":"猫01/左眼","x":247,"height":60,"y":666,"width":59},{"name":"猫01/左眉毛","x":247,"height":12,"y":602,"width":31},{"name":"猫01/眼镜","x":301,"height":63,"y":525,"width":170},{"name":"猫01/胡子","x":123,"height":85,"y":515,"width":176},{"name":"猫01/鼻子","x":67,"height":24,"y":569,"width":28},{"name":"猫01/嘴","x":1,"height":30,"y":299,"width":65},{"name":"猫01/帽子","x":123,"height":102,"y":411,"width":158}],"height":1024,"width":512}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "f22c3dd7-04ac-4af8-9aed-8fb07ecf8b62",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "b711f7df-44ea-4820-9947-d53e77b2eac4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 1024,
"platformSettings": {},
"subMetas": {
"mao_tex": {
"ver": "1.0.4",
"uuid": "676e80fb-e46c-4602-bd5a-fc965b3f7889",
"rawTextureUuid": "b711f7df-44ea-4820-9947-d53e77b2eac4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -7.5,
"offsetY": 138.5,
"trimX": 1,
"trimY": 1,
"width": 495,
"height": 745,
"rawWidth": 512,
"rawHeight": 1024,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
"__id__": 2 "__id__": 2
}, },
{ {
"__id__": 14 "__id__": 18
}, },
{ {
"__id__": 15 "__id__": 19
} }
], ],
"_active": false, "_active": false,
...@@ -79,18 +79,21 @@ ...@@ -79,18 +79,21 @@
}, },
{ {
"__id__": 5 "__id__": 5
},
{
"__id__": 11
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 11 "__id__": 15
}, },
{ {
"__id__": 12 "__id__": 16
}, },
{ {
"__id__": 13 "__id__": 17
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -491,6 +494,201 @@ ...@@ -491,6 +494,201 @@
"_originalHeight": 100, "_originalHeight": 100,
"_id": "ceuFd5fJtHL7nlxNnSnNC5" "_id": "ceuFd5fJtHL7nlxNnSnNC5"
}, },
{
"__type__": "cc.Node",
"_name": "catFrame",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 12
}
],
"_active": true,
"_components": [
{
"__id__": 14
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1088,
"height": 800
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "27rQLa4hFLCYYngTIhr5wQ"
},
{
"__type__": "cc.Node",
"_name": "cat",
"_objFlags": 0,
"_parent": {
"__id__": 11
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 362.6105263157899,
"height": 483.5647539622176
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
0.5,
0.5,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bfjTPlvwZGZKCBvP+inTwh"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "9096ad01-828a-45a8-8e37-b2d813b1ed37#f22c3dd7-04ac-4af8-9aed-8fb07ecf8b62",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "9096ad01-828a-45a8-8e37-b2d813b1ed37"
},
"_N$dragonAtlasAsset": {
"__uuid__": "f22c3dd7-04ac-4af8-9aed-8fb07ecf8b62"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 3,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "1faXXhRI1KLqhSa0Kh9gAs"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 36,
"_left": 544,
"_right": 0,
"_top": 400,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "dfPm4AKlJGOpFnlHIOjQvT"
},
{ {
"__type__": "cc.Canvas", "__type__": "cc.Canvas",
"_name": "", "_name": "",
...@@ -614,10 +812,10 @@ ...@@ -614,10 +812,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 16 "__id__": 20
}, },
{ {
"__id__": 17 "__id__": 21
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -673,7 +871,7 @@ ...@@ -673,7 +871,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 15 "__id__": 19
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -705,7 +903,7 @@ ...@@ -705,7 +903,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 15 "__id__": 19
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
......
...@@ -141,22 +141,31 @@ cc.Class({ ...@@ -141,22 +141,31 @@ cc.Class({
}, },
initView() { initView() {
this.coolCatSpeakStart(() => {
});
const canvas = cc.find('Canvas'); const canvas = cc.find('Canvas');
const bg = cc.find('Canvas/bg/ImgBg'); const bg = cc.find('Canvas/bg/ImgBg');
this.loadSpriteByUrl(bg, this.data.bgItem.url, () => { this.loadSpriteByUrl(bg, this.data.bgItem.url, () => {
bg.scale = Math.min((canvas.width / bg.width), (canvas.height / bg.height)); bg.scale = Math.min((canvas.width / bg.width), (canvas.height / bg.height));
this.itemList = [];
this.data.hotZoneItemArr.forEach(async itemData => { this.data.hotZoneItemArr.forEach(async itemData => {
const item = await this.createItem(itemData, bg); const item = await this.createItem(itemData, bg);
item.on('click', () => { item.on('click', () => {
playAudioByUrl(itemData.audio_url); playAudioByUrl(itemData.audio_url);
const time = 0.05; const time = 0.05;
item.clicked = true;
if (this.itemList.every(item => item.clicked)) {
this.coolCatSpeakEnd();
}
cc.tween(item) cc.tween(item)
.to(time, { angle: 10 }) .to(time, { angle: 10 })
.to(time * 2, { angle: -10 }) .to(time * 2, { angle: -10 })
.to(time, { angle: 0 }) .to(time, { angle: 0 })
.start(); .start();
}); });
this.itemList.push(item);
}); });
}); });
}, },
...@@ -180,6 +189,25 @@ cc.Class({ ...@@ -180,6 +189,25 @@ cc.Class({
}, },
coolCatSpeakStart(cb) {
const cat = cc.find('Canvas/bg/catFrame/CoolCat');
playDragonBoneAnimation(cat, 'begin', -1);
this.playAudioByUrl(this.data.startAudio, () => {
playDragonBoneAnimation(cat, 'normal', -1);
cb();
});
},
coolCatSpeakEnd(cb) {
const cat = cc.find('Canvas/bg/catFrame/CoolCat');
playDragonBoneAnimation(cat, 'finish', -1);
this.playAudioByUrl(this.data.endAudio, () => {
playDragonBoneAnimation(cat, 'normal', -1);
cb();
});
},
......
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