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