Commit 58284ff8 authored by linzhiguo's avatar linzhiguo

+ 321 开场

+ 增加几个音效
parent 4350d553
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b", "uuid": "514e24a6-4a9b-4a5c-9250-6e11f297b0d0",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.130612, "duration": 0.5774,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "549152ab-1dde-49e3-9240-0e428ac6f29a",
"downloadMode": 0,
"duration": 0.711688,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "1c63bc28-619a-472f-af67-9263b9535165",
"downloadMode": 0,
"duration": 1.802449,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "b13ae152-f1bb-43b9-8784-a50dee754e38",
"downloadMode": 0,
"duration": 4,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "8c14b3b8-8840-4464-bfee-0e9e1e70aac2",
"downloadMode": 0,
"duration": 3.787755,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -129,6 +129,10 @@ cc.Class({ ...@@ -129,6 +129,10 @@ cc.Class({
this._flyswatter = cc.find('Canvas/flyswatter'); this._flyswatter = cc.find('Canvas/flyswatter');
this.setOrignPos(this._flyswatter); this.setOrignPos(this._flyswatter);
let node = cc.find('Canvas/timer');
this._time_text = node.getComponent(cc.Label);
this._time_text.sub = node.children[0].getComponent(cc.Label);
}, },
cleanFlys(){ cleanFlys(){
...@@ -256,6 +260,7 @@ cc.Class({ ...@@ -256,6 +260,7 @@ cc.Class({
for(let i = 0; i < 2; i++){ for(let i = 0; i < 2; i++){
item = this.flys[i]; item = this.flys[i];
if (cc.rect(item.getBoundingBoxToWorld()).contains(event.touch._point)){ if (cc.rect(item.getBoundingBoxToWorld()).contains(event.touch._point)){
this.playAudioByName('dizzy');
this.cleanTimer(); this.cleanTimer();
this._flyswatter.x = pos.x; this._flyswatter.x = pos.x;
this._flyswatter.y = pos.y; this._flyswatter.y = pos.y;
...@@ -296,6 +301,12 @@ cc.Class({ ...@@ -296,6 +301,12 @@ cc.Class({
}, },
playGame(){ playGame(){
this.playTimer(()=>{
this.startItem();
});
},
startItem(){
this._sound_button._sprite.active = true; this._sound_button._sprite.active = true;
let item = this.data[this._index]; let item = this.data[this._index];
...@@ -310,6 +321,38 @@ cc.Class({ ...@@ -310,6 +321,38 @@ cc.Class({
}); });
}, },
playTimer(cb){
this.playAudioByName('time321');
this._time_text.node.active = true;
this.setTimerString('3');
cc.tween(this._time_text.node)
.to(0.25, {scale: 1.2},{ easing: 'quadIn' })
.to(0.5, {scale: 0.8},{ easing: 'quadOut' })
.to(0.25, {scale: 1},{ easing: 'quadIn' })
.call(()=>{
this.setTimerString(2);
})
.to(0.25, {scale: 1.2},{ easing: 'quadIn' })
.to(0.5, {scale: 0.8},{ easing: 'quadOut' })
.to(0.25, {scale: 1},{ easing: 'quadIn' })
.call(()=>{
this.setTimerString(1);
})
.to(0.25, {scale: 1.2},{ easing: 'quadIn' })
.to(0.5, {scale: 0.8},{ easing: 'quadOut' })
.to(0.25, {scale: 1},{ easing: 'quadIn' })
.call(()=>{
this._time_text.node.active = false;
cb && cb();
})
.start();
},
setTimerString(str){
this._time_text.string = str;
this._time_text.sub.string = str;
},
setTimer(){ setTimer(){
this._current_time = this._time_node.x; this._current_time = this._time_node.x;
this._timer_ani = cc.tween(this._time_node) this._timer_ani = cc.tween(this._time_node)
...@@ -427,7 +470,7 @@ cc.Class({ ...@@ -427,7 +470,7 @@ cc.Class({
this._index ++; this._index ++;
if (this._index >= this.data.length){ if (this._index >= this.data.length){
//this.playAudioByName('victory'); this.playAudioByName('victory');
this._flower.active = true; this._flower.active = true;
playDragonBoneAnimation(this._flower, 'normal'); playDragonBoneAnimation(this._flower, 'normal');
return; return;
...@@ -526,7 +569,7 @@ cc.Class({ ...@@ -526,7 +569,7 @@ cc.Class({
cc.tween(this._cup) cc.tween(this._cup)
.to(0.8, {y: this._cup._y}, { easing: 'quadOut' }) .to(0.8, {y: this._cup._y}, { easing: 'quadOut' })
.call(()=>{ .call(()=>{
this.playGame(); this.startItem();
}) })
.start(); .start();
}, },
......
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