Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiles out of sync #13

Open
Steven4294 opened this issue May 27, 2015 · 2 comments
Open

Tiles out of sync #13

Steven4294 opened this issue May 27, 2015 · 2 comments

Comments

@Steven4294
Copy link

img_1744

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

@chenshengzhi
Copy link

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

@Steven4294
Copy link
Author

Thanks man

Sent from my iPhone

On May 27, 2015, at 8:40 PM, chenshengzhi notifications@github.com 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants