2048 icon indicating copy to clipboard operation
2048 copied to clipboard

Tiles out of sync

Open Steven4294 opened this issue 9 years ago • 2 comments

img_1744

To reproduce this bug, just swipe really fast on the device. I'm not really sure how to go about fixing this.

Steven4294 avatar May 27 '15 19:05 Steven4294

when the new swip begin, enumerate all M2Tile to check if need remove or relayout

- (void)clearForNewUnserInteraction
{
    // 移除的
    if (_destRemove) {
        [self removeAllActions];
        [_pendingActions removeAllObjects];
        [self runAction:[SKAction removeFromParent] completion:^{
            [self removeFromParentCell];
        }];
    }
    // 移动的
    else if (_pendingActions.count > 0 /* 移动的 */ || [self hasActions] /* 新增的 */) {
        [self removeAllActions];
        [_pendingActions removeAllObjects];

        SKAction *layout = [SKAction runBlock:^{
            self.position = [GSTATE locationOfPosition:self.cell.position];
            [self setScale:1];
            [self updateLevelTo:self.level];
        }];
        [self runAction:layout completion:^{
            if (_pendingBlock) {
                _pendingBlock();
                _pendingBlock = nil;
            }
        }];
    }
}

you can check out my fork

chenshengzhi avatar May 28 '15 00:05 chenshengzhi

Thanks man

Sent from my iPhone

On May 27, 2015, at 8:40 PM, chenshengzhi [email protected] wrote:

when the new swip begin, enumerate all M2Tile to check if need remove or relayout

  • (void)clearForNewUnserInteraction { // 移除的 if (_destRemove) { [self removeAllActions]; [_pendingActions removeAllObjects]; [self runAction:[SKAction removeFromParent] completion:^{ [self removeFromParentCell]; }]; } // 移动的 else if (_pendingActions.count > 0 /* 移动的 / || [self hasActions] / 新增的 */) { [self removeAllActions]; [_pendingActions removeAllObjects];

    SKAction *layout = [SKAction runBlock:^{
        self.position = [GSTATE locationOfPosition:self.cell.position];
        [self setScale:1];
        [self updateLevelTo:self.level];
    }];
    [self runAction:layout completion:^{
        if (_pendingBlock) {
            _pendingBlock();
            _pendingBlock = nil;
        }
    }];
    

    } } you can check out my fork

— Reply to this email directly or view it on GitHub.

Steven4294 avatar May 28 '15 01:05 Steven4294