Commit 21babf93 authored by Tt's avatar Tt

调整爪子效果

parent 6e31dbf7
......@@ -112,5 +112,5 @@ let question = [
]
1.背景图需要切图分开。
2.爪子动画需要提供
\ No newline at end of file
2.抓娃娃前start按钮提示,放大缩小。
3.爪子偏上锁定。 抓起卡片需要带着卡片一起运动。 卡片放大需要现在1.5倍左右。
\ No newline at end of file
This diff is collapsed.
......@@ -65,7 +65,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
_cantouch = null;
private list: Array<{
questionAudio, image, letterList, recordData, isChose//用于判定对错 right wrong
title, questionAudio, image, letterList, recordData, isChose//用于判定对错 right wrong
}>;
private recordFlag: number;//录音模式
private score: number;
......@@ -126,6 +126,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.count = 0;
this.touchForbid = true;
this.voiceTouchForbid = true;
if (!this.CurrentData.title) this.label_title.active = false;
pg.view.setString(this.label_title, this.CurrentData.title)
this.gou_node.orgPos = cc.v2(this.gou_node)
let currentLayer = this.createLayer();
this.updateLayer(currentLayer, this.CurrentData, this.count)
......@@ -136,8 +138,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.layers.push(nextLayer)
// 循环播放三个卡片的tips
this.checkCardsTime = 0;
if (!this.data.title) this.label_title.active = false;
pg.view.setString(this.label_title, this.data.title)
}
@property(cc.Node)
label_title: cc.Node = null;
......@@ -150,6 +150,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 自动播放顶部音频
this.touchForbid = true;
cc.tween(this.btn_start).repeatForever(
cc.tween().to(0.5, { scale: 1.1 }).to(0.5, { scale: 1.0 })
).start();
this.scheduleOnce(() => {
this.touchForbid = false;
}, 0.1)
......@@ -529,6 +533,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
private btn_start: cc.Node = null;
onTouchStart(e) {
if (this.touchForbid) return;// 顶级禁止全部点击
cc.Tween.stopAllByTarget(this.btn_start)
this.btn_start.scale = 1;
this.touchForbid = true;
// 处理问题
let image = pg.view.find(this.btn_start, 'image');
......@@ -565,21 +571,22 @@ export default class SceneComponent extends MyCocosSceneComponent {
let ani = pg.view.playDBAnimation(pg.view.find(this.gou_node, 'ani'), 'newAnimation', 1);
ani.timeScale = 1;
})
.delay(0.7)
// 等待动画
.delay(1)
// 获取图片坐标后隐藏
.call(() => {
let ani = pg.view.playDBAnimation(pg.view.find(this.gou_node, 'ani'), 'newAnimation', 1);
ani.timeScale = -1;
this.touchForbid = false;
// showRecord 传递坐标 执行内部动画效果
this.showRecord(item);
})
.to(0.3, { y: item.y + item.height / 2 + 50 })
// 获取图片坐标后隐藏
.call(() => {
let ani = pg.view.playDBAnimation(pg.view.find(this.gou_node, 'ani'), 'newAnimation', 1);
ani.timeScale = -1;
})
.delay(1)
.call(() => {
pg.view.playDBAnimation(pg.view.find(this.gou_node, 'ani'), 'newAnimation', 1);
// pg.view.playDBAnimation(pg.view.find(this.gou_node, 'ani'), 'newAnimation', 1);
pg.view.visible(pg.view.find(this.gou_node, 'img'), true);
pg.view.visible(pg.view.find(this.gou_node, 'ani'), false);
})
......@@ -594,65 +601,66 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node)
private btn_close: cc.Node = null;
showRecord(item) {
item.active = false;
this.layout_record.active = true;
// 卡片显示
let bg = pg.view.find(this.layout_record, 'bg')
bg.opacity = 0;
cc.tween(bg).to(0.5, { opacity: 155 }).start();
let card = pg.view.find(this.layout_record, 'card')
this.updateCard(card, this.currentDt)
let startPos = cc.v2(item);
let endPos = cc.v2(card);
let startScale = item.width / card.width
card.scale = startScale;
card.x = startPos.x;
card.y = startPos.y;
cc.tween(card).to(0.5, { x: endPos.x, y: endPos.y, scale: 1 }).start();
cc.tween(item).to(0.3, { y: startPos.y + 50 }).call(() => {
item.active = false;
item.y = startPos.y;
this.layout_record.active = true;
// 卡片显示
let bg = pg.view.find(this.layout_record, 'bg')
bg.opacity = 0;
cc.tween(bg).to(0.5, { opacity: 155 }).start();
let card = pg.view.find(this.layout_record, 'card')
this.updateCard(card, this.currentDt)
let endPos = cc.v2(card);
let startScale = item.width / card.width
card.scale = startScale;
card.x = startPos.x;
card.y = startPos.y + 50;
cc.tween(card).delay(0.3).to(0.5, { x: endPos.x, y: endPos.y, scale: 1.7 }).start();
// 音频处理
let btn_voice = pg.view.find(this.layout_record, 'btn_voice')
btn_voice.data = this.currentDt;
// 展示待录音内容
let normal = pg.view.find(btn_voice, 'normal')
let ing = pg.view.find(btn_voice, 'ing')
btn_voice.scale = 0;
cc.tween(btn_voice).to(0.3, { scale: 1.5 }).start();
pg.view.visible(normal, true)
pg.view.visible(ing, false)
cc.tween(normal)
.repeatForever(
cc.tween()
.to(0.2, { angle: -18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: 18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: -18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: 18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: -18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: 18 })
.to(0.2, { angle: 0 })
.delay(1)
)
.start();
pg.view.touchOn(btn_voice, this.onTouchCardRecord, this)
}).start();
// 音频处理
let btn_voice = pg.view.find(this.layout_record, 'btn_voice')
btn_voice.data = this.currentDt;
// 展示待录音内容
let normal = pg.view.find(btn_voice, 'normal')
let ing = pg.view.find(btn_voice, 'ing')
btn_voice.scale = 0;
cc.tween(btn_voice).to(0.3, { scale: 1.5 }).start();
pg.view.visible(normal, true)
pg.view.visible(ing, false)
cc.tween(normal)
.repeatForever(
cc.tween()
.to(0.2, { angle: -18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: 18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: -18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: 18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: -18 })
.to(0.2, { angle: 0 })
.to(0.2, { angle: 18 })
.to(0.2, { angle: 0 })
.delay(1)
)
.start();
// this.btn_voice_time_id = setTimeout(() => {
// if (!this.node || !this.node.parent) return;
// // 摇晃mic
// this.playLocalAudio("wait")
// cc.tween(normal).to(0.25, { angle: -15 }).to(0.25, { angle: 0 }).to(0.25, { angle: 15 }).to(0.25, { angle: 0 }).start();
// }, 3000);
pg.view.touchOn(btn_voice, this.onTouchCardRecord, this)
}
onTouchRecordClose() {
this.layout_record.active = false;
......
......@@ -8,7 +8,7 @@
"genMipmaps": false,
"packable": true,
"width": 1688,
"height": 780,
"height": 1688,
"platformSettings": {},
"subMetas": {
"bg_0_jj15_zww": {
......@@ -23,9 +23,9 @@
"trimX": 0,
"trimY": 0,
"width": 1688,
"height": 780,
"height": 1688,
"rawWidth": 1688,
"rawHeight": 780,
"rawHeight": 1688,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
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