raspu / RPTileScroller

SpriteKit Infinite Tile Scroller
MIT License
19 stars 2 forks source link

Movement Update #1

Open Mazyod opened 9 years ago

Mazyod commented 9 years ago

First, thank you for this, saved me a lot of time.

Now, for my purposes, I already have a "Camera" class that tracks the player on each update, and makes sense for me to control the tile scroller precisely, without running any actions.

i.e. Here is what I did:

- (void)setMoveVector:(CGVector)moveVector
{
    _moveVector = moveVector;
    _rootNode.position = CGPointMake(
            _rootNode.position.x + moveVector.dx
            , _rootNode.position.y + moveVector.dy
    );
}

I update the node position instantly, since I need it to be at that position on the next update.

Instead of hacking the library, I can submit a PR to either expose the rootNode, or provide another property that will update the rootNode's position synchronously.

Thoughts?

raspu commented 9 years ago

You are welcome, I am glad you found it useful.

Good idea, thanks for your time. A new property will be perfect, I would rather don't expose the _rootNode (Unless there's a really good reason).

Thank you :+1: .