Commit 05d26a4e authored by wildfirecode's avatar wildfirecode

1

parent df9efc28
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -61,7 +61,7 @@ export default class Conveyors extends engine.Sprite {
view.isRight = false;
data.isOnStage = true;
view.data=data;
view.type = data.type;
view.name = data.name;
view.anchorX = data.width / 2;
......@@ -116,6 +116,7 @@ export default class Conveyors extends engine.Sprite {
if (data) {
data.isOnStage = true;
let view: any = new engine.Sprite(getTextureByName(data.source));
view.data = data;
view.isWrong = false;
view.isRight = false;
view.type = data.type;
......@@ -233,7 +234,7 @@ export default class Conveyors extends engine.Sprite {
}
private _currentDragView: engine.Sprite;
private _currentTarget: engine.Sprite;
private _currentTarget;
onDown_garbage(e: engine.MouseEvent) {
if (this._currentDragView) {
removeChild(this._currentDragView)
......@@ -269,6 +270,7 @@ export default class Conveyors extends engine.Sprite {
if (result == this._currentDragView['type']) {//匹配
this.addscore();
this.wrapper.rightTips.play(getTargetRect(result,this.wrapper));
this._currentTarget.data.isRight=true;
} else {//不匹配
engine.Tween.get(this._currentTarget).to({ scaleX: 1, scaleY: 1 }, 300).call(() => { });
this.wrapper.wrongTips.play(getTargetRect(result,this.wrapper));
......
......@@ -49,7 +49,8 @@ export default (list: any[]) => {
return {
'targetName': getTargetName(i.targetType),
'isCorrect': i.targetType == i.itemType,
'itemName': i.itemName
'itemName': i.itemName,
'itemTypeName':getTargetName(i.itemType)
}
})
}
......
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