Commit 78cf8d8c authored by linzhiguo's avatar linzhiguo

+ 全错动画 音效

- 表单 标题声音
- 321动画
# 打错后立即打对
parent 58284ff8
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
</div> </div>
</div> </div>
<div style="display: flex; margin-bottom: 10px;"> <!-- <div style="display: flex; margin-bottom: 10px;">
<div style="flex:1;margin-left: 10px;"> <div style="flex:1;margin-left: 10px;">
音频 音频
</div> </div>
<div style="flex:5"> <div style="flex:5">
<app-audio-recorder [audioUrl]="item.audio_url" (audioUploaded)="onAudioUploadSuccess($event, item, 'audio_url')" ></app-audio-recorder> <app-audio-recorder [audioUrl]="item.audio_url" (audioUploaded)="onAudioUploadSuccess($event, item, 'audio_url')" ></app-audio-recorder>
</div> </div>
</div> </div> -->
<div style="display: flex; margin-bottom: 10px;"> <div style="display: flex; margin-bottom: 10px;">
<div style="flex:1; margin-left: 10px;"> <div style="flex:1; margin-left: 10px;">
......
{
"ver": "2.0.1",
"uuid": "5d1f8368-bddf-471a-847a-e2a6876ec5f0",
"downloadMode": 0,
"duration": 3.761633,
"subMetas": {}
}
\ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "8c14b3b8-8840-4464-bfee-0e9e1e70aac2", "uuid": "8c14b3b8-8840-4464-bfee-0e9e1e70aac2",
"downloadMode": 0, "downloadMode": 0,
"duration": 3.787755, "duration": 2.298776,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{"frameRate":24,"name":"comeon","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"Armature","aabb":{"x":-360.46,"y":-155.14,"width":720,"height":199},"bone":[{"name":"root"},{"name":"WL-comeon","parent":"root","transform":{"x":-2.65,"y":-22.55}}],"slot":[{"name":"WL-comeon","parent":"WL-comeon"}],"skin":[{"slot":[{"name":"WL-comeon","display":[{"name":"WL-comeon","transform":{"x":2.19,"y":-33.09}}]}]}],"animation":[{"duration":34,"playTimes":0,"name":"newAnimation","bone":[{"name":"WL-comeon","translateFrame":[{"duration":12,"tweenEasing":0,"y":-477.5},{"duration":6,"tweenEasing":0,"y":24.18},{"duration":6,"tweenEasing":0,"y":-2.9},{"duration":10,"tweenEasing":0,"y":24.18},{"duration":0,"y":567.5}]}]}],"defaultActions":[{"gotoAndPlay":"newAnimation"}],"canvas":{"width":1280,"height":720}}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "38dc6f23-ad7c-40aa-b453-55fcf4ef11f2",
"subMetas": {}
}
\ No newline at end of file
{"width":1024,"imagePath":"comeon_tex.png","height":256,"name":"comeon","SubTexture":[{"width":720,"y":1,"height":199,"name":"WL-comeon","x":1}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "fabcd065-ac14-49cf-9f17-b066de40f358",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "bfacd412-f2b8-4bdd-a557-79117529901e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 1024,
"height": 256,
"platformSettings": {},
"subMetas": {
"comeon_tex": {
"ver": "1.0.4",
"uuid": "277729c8-034d-4837-827c-2da49aa5498e",
"rawTextureUuid": "bfacd412-f2b8-4bdd-a557-79117529901e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -151,
"offsetY": 27.5,
"trimX": 1,
"trimY": 1,
"width": 720,
"height": 199,
"rawWidth": 1024,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"_name": "sound", "_name": "sound",
"_objFlags": 0, "_objFlags": 0,
"_native": "", "_native": "",
"_duration": 0.25, "_duration": 1,
"sample": 60, "sample": 60,
"speed": 1, "speed": 1,
"wrapMode": 2, "wrapMode": 2,
...@@ -17,24 +17,28 @@ ...@@ -17,24 +17,28 @@
"value": true "value": true
}, },
{ {
"frame": 0.05, "frame": 0.16666666666666666,
"value": false "value": false
}, },
{ {
"frame": 0.1, "frame": 0.3333333333333333,
"value": true "value": true
}, },
{ {
"frame": 0.15, "frame": 0.5,
"value": false "value": false
}, },
{ {
"frame": 0.2, "frame": 0.6666666666666666,
"value": true "value": true
}, },
{ {
"frame": 0.25, "frame": 0.8333333333333334,
"value": false "value": false
},
{
"frame": 1,
"value": true
} }
] ]
} }
...@@ -47,24 +51,28 @@ ...@@ -47,24 +51,28 @@
"value": false "value": false
}, },
{ {
"frame": 0.05, "frame": 0.16666666666666666,
"value": true "value": true
}, },
{ {
"frame": 0.1, "frame": 0.3333333333333333,
"value": false "value": false
}, },
{ {
"frame": 0.15, "frame": 0.5,
"value": true "value": true
}, },
{ {
"frame": 0.2, "frame": 0.6666666666666666,
"value": false "value": false
}, },
{ {
"frame": 0.25, "frame": 0.8333333333333334,
"value": true "value": true
},
{
"frame": 1,
"value": false
} }
] ]
} }
......
This diff is collapsed.
...@@ -121,6 +121,9 @@ cc.Class({ ...@@ -121,6 +121,9 @@ cc.Class({
this._flower = cc.find('Canvas/flower'); this._flower = cc.find('Canvas/flower');
this._flower.active = false; this._flower.active = false;
this._comeon = cc.find('Canvas/comeon');
this._comeon.active = false;
this.cleanFlys(); this.cleanFlys();
this._cup = cc.find('Canvas/bg/cup'); this._cup = cc.find('Canvas/bg/cup');
...@@ -240,14 +243,19 @@ cc.Class({ ...@@ -240,14 +243,19 @@ cc.Class({
this.updateItem(); this.updateItem();
this._cup._y = this._cup.y; this._cup._y = this._cup.y;
if (audio_url && audio_url!=""){ this._start = cc.find('Canvas/start');
playAudioByUrl(audio_url, ()=>{ this._start.on('click',()=>{
this._start.active = false;
// let audio_url = this.data.audio_url;
// if (audio_url && audio_url!=""){
// playAudioByUrl(audio_url, ()=>{
// this.playGame();
// });
// }
// else{
this.playGame(); this.playGame();
// }
}); });
}
else{
this.playGame();
}
this.node.on(cc.Node.EventType.TOUCH_START, (event)=>{ this.node.on(cc.Node.EventType.TOUCH_START, (event)=>{
if (this._touched == true) if (this._touched == true)
...@@ -301,9 +309,9 @@ cc.Class({ ...@@ -301,9 +309,9 @@ cc.Class({
}, },
playGame(){ playGame(){
this.playTimer(()=>{ //this.playTimer(()=>{
this.startItem(); this.startItem();
}); //});
}, },
startItem(){ startItem(){
...@@ -463,6 +471,9 @@ cc.Class({ ...@@ -463,6 +471,9 @@ cc.Class({
}, },
tryFinish(){ tryFinish(){
if (this._finished == true)
return;
if (this._timer_ani){ if (this._timer_ani){
this._timer_ani.stop(); this._timer_ani.stop();
this._timer_ani = null; this._timer_ani = null;
...@@ -470,9 +481,20 @@ cc.Class({ ...@@ -470,9 +481,20 @@ cc.Class({
this._index ++; this._index ++;
if (this._index >= this.data.length){ if (this._index >= this.data.length){
this._finished = true;
if (this.allWrong() == true){
this.playAudioByName('lose');
this._comeon.active = true;
playDragonBoneAnimation(this._comeon, 'newAnimation', 1, ()=>{
this._comeon.active = false;
});
}
else{
this.playAudioByName('victory'); this.playAudioByName('victory');
this._flower.active = true; this._flower.active = true;
playDragonBoneAnimation(this._flower, 'normal'); playDragonBoneAnimation(this._flower, 'normal');
}
return; return;
} }
...@@ -555,8 +577,11 @@ cc.Class({ ...@@ -555,8 +577,11 @@ cc.Class({
cc.tween(this._time_node) cc.tween(this._time_node)
.delay(1) .delay(1)
.call(()=>{ .call(()=>{
playDragonBoneAnimation(this.flys[0], 'normal', -1); this.cleanTimer();
playDragonBoneAnimation(this.flys[1], 'normal', -1); for(let i = 0; i < 2; i++){
this.flys[i].x = this.flys[i]._x + this._frameSize.width * 1.5;
playDragonBoneAnimation(this.flys[i], 'normal', -1);
}
this.tryFinish(); this.tryFinish();
}) })
.start(); .start();
...@@ -587,7 +612,7 @@ cc.Class({ ...@@ -587,7 +612,7 @@ cc.Class({
allWrong(){ allWrong(){
let item, len = this._area.childrenCount; let item, len = this._area.childrenCount;
for(let i = 0; i <len; i++){ for(let i = 0; i <len; i++){
item = this._area[i]; item = this._area.children[i];
if (item.children[0].active == true) if (item.children[0].active == true)
return false; return false;
} }
......
{
"ver": "2.3.5",
"uuid": "ce7f34ca-1c77-409b-9c2e-5e26b5dcd084",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 456,
"height": 102,
"platformSettings": {},
"subMetas": {
"start": {
"ver": "1.0.4",
"uuid": "86c61d4f-3fc6-49f0-9cd5-a30c42d981c9",
"rawTextureUuid": "ce7f34ca-1c77-409b-9c2e-5e26b5dcd084",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 456,
"height": 102,
"rawWidth": 456,
"rawHeight": 102,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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