Experimental: improve animation, reduce lags in stack moves sending. Add Allmate
[xogo.git] / variants / Suction / class.js
index e2e36c8..dbaefa0 100644 (file)
@@ -110,4 +110,13 @@ export default class SuctionRules extends ChessRules {
     return "*";
   }
 
+  // Better animation for swaps
+  customAnimate(move, segments, cb) {
+    if (move.vanish.length < 2)
+      return 0;
+    super.animateMoving(move.end, move.start, null,
+                        segments.reverse().map(s => s.reverse()), cb);
+    return 1;
+  }
+
 };