Procházet zdrojové kódy

Merge branch 'master' of http://git.onarbooks.com/LosPoulos/mafalda-web

Dim Dim před 6 roky
rodič
revize
1237d06e45

+ 2 - 0
src/Game/views/demo/CardToHolder.js

@@ -9,6 +9,8 @@ class CardToHolder extends PIXI.Container{
 
         let card = new Card({});
         this.addChild(card);
+        let card2 = new Card({'x': -200});
+        this.addChild(card2);
 
         let holder = new CardHolder({'x':-170,'y':0,'w':203,'h':323});
         this.addChild(holder);

+ 3 - 4
src/helpers/dragAndDrop.js

@@ -1,7 +1,5 @@
 import EventManager from '../Game/services/EventManager';
 
-
-
 function dragAndDrop(sprite) {
 // Sprite must be interactive and if container Hit Area must be specified!
     sprite
@@ -18,8 +16,9 @@ function dragAndDrop(sprite) {
         .on('touchmove', onDragMove);
 
     EventManager.on('CardPlaced', (position) => {
-        console.log("CardPlaced");
-        sprite.placedPosition = position;
+        if(sprite.dragging) {
+            sprite.placedPosition = position;
+        }
     });
 }