Commit e975e26a authored by Tt's avatar Tt

拖拽完成

parent 58994e8b
{
"ver": "2.0.1",
"uuid": "aa5dce85-83fb-44b4-817f-245e86d4bde9",
"downloadMode": 0,
"duration": 0.556563,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "433c5b0a-ebaa-4398-90aa-5e0d8ce58189",
"downloadMode": 0,
"duration": 0.39185,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "1df07874-8c2a-4e48-871b-9550d01c9e5f",
"downloadMode": 0,
"duration": 2.403265,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "bfa2aa31-940a-47ed-b340-9a682440aab0",
"downloadMode": 0,
"duration": 1.959184,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "d1f740c5-6b88-4cec-8a02-151be9cefe61",
"downloadMode": 0,
"duration": 0.938688,
"subMetas": {}
}
\ No newline at end of file
......@@ -194,6 +194,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
})
}
// 更新当前面板颜色
updateCurrentNodeColor(node, data) {
let label = node.getChildByName('label')
pg.view.visible(label, true)
pg.view.setString(label, data.word)
for (let i = 1; i <= 5; i++) {
pg.view.visible(pg.view.find(node, 'img_keyboard_' + i), data.color == i);
}
let block = node.data;
block.val = data.word;
}
getBlockNodeByPos(x, y) {
return this.layout_blocks.children.find(node => node.data.x == x && node.data.y == y)
}
......@@ -284,41 +296,43 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.touching = null;
target.x = target.data.pos.x;
target.y = target.data.pos.y;
// this.playLocalAudio('error').then(() => {
// this.touching = null;
// // this.updateItem(target, data);
// })
return;
}
//是否正确
let isRight = collNode.data.rightVal == data.word;
if (isRight) {
let item = target;
// this.playLocalAudio('right').then(() => {
// if (data.audioUrl) {
// pg.audio.playAudioByUrlThen(data.audioUrl).then(() => {
// this.touching = null;
// })
// } else {
// this.touching = null;
// }
// })
this.playLocalAudio('move').then(() => { })
let item = target;
cc.tween(target).to(0.15, { scale: 0.9, rotation: 0 }).call(() => {
// block需要显示内容
this.updateCurrentNodeColor(collNode, data);
target.active = false;
this.touching = null;
item.off(cc.Node.EventType.TOUCH_START, this.onItemTouchStart, this);
item.off(cc.Node.EventType.TOUCH_MOVE, this.onItemTouchMove, this);
item.off(cc.Node.EventType.TOUCH_END, this.onItemTouchEnd, this);
item.off(cc.Node.EventType.TOUCH_CANCEL, this.onItemTouchCancel, this);
} else {
// this.playLocalAudio('error').then(() => {
// this.touching = null;
// // this.updateItem(target, data);
// })
this.touching = null;
target.x = target.data.pos.x;
target.y = target.data.pos.y;
}
// 判断此行是否完成
let lineFull = true;
if (lineFull) {
} else {
// 下一个格子刷新聚焦
this.updateHightLight();
}
}).start();
// this.playLocalAudio('right').then(() => {
// if (data.audioUrl) {
// pg.audio.playAudioByUrlThen(data.audioUrl).then(() => {
// this.touching = null;
// })
// } else {
// this.touching = null;
// }
// })
// this.touching = null;
// target.x = target.data.pos.x;
// target.y = target.data.pos.y;
// 检测一行是否完成, 完成加星星
// pg.event.emit('mouse_05_add')
......
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