Nikatlas 6 سال پیش
والد
کامیت
1ef9e0e1f5
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 0 2
      src/Game/views/base/Card.js
  2. 4 2
      src/Game/views/base/CardHolder.js

+ 0 - 2
src/Game/views/base/Card.js

@@ -123,8 +123,6 @@ class Card extends GuiableContainer{
     moveTo(point, milliseconds=1000) {
         let path = new PIXI.tween.TweenPath();
         path.moveTo(this.position.x, this.position.y).lineTo(point.x, point.y);
-        console.log(this.position.x);
-        console.log(this.position.y);
 
         this._tween = PIXI.tweenManager.createTween(this);
         this._tween.easing = PIXI.tween.Easing.outQuart();

+ 4 - 2
src/Game/views/base/CardHolder.js

@@ -45,10 +45,12 @@ class CardHolder extends GuiableContainer{
         this.sprite.interactive = true;
         this.sprite.hitArea = new PIXI.Rectangle(0, 0, this.w, this.h);
         this.sprite.cursor = 'pointer';
-        this.sprite.on('mouseup', () => {
+        let fn = () => {
             // This is called before it is removed from the DragEnd Callback
             EventManager.trigger('CardPlaced', [this, this._onDrop]); 
-        });
+        };
+        this.sprite.on('mouseup', fn);
+        this.sprite.on('touchend', fn);
 
         this.position.set(this.x,this.y);