I playing with tilemaps and attempting to show only one room at a time. I want my player to be able to move all around the room without the tilemap showing other rooms. Once the player enters the door to go into another room, I want to transition from Room A to Room B. The best way I know to describe what I am trying to accomplish is to look at the old NES style Legend of Zelda. When Zelda would move from room to room.
The second thing I am trying to do is Zoom the TileMap to fill just that room. I have played with the camera class and I am failing at understanding what it's asking to do.
While the tilemap is 256 tiles wide, I only want to display 16 x 12 tiles (32pixels * 16 tiles) x (32pixels * 12 tiles)
I am not asking anyone to write the code for me. I have been working off of the Ray Wenderlich's tilemap tutorial which has taught me a lot. Just point me in the direction of where I can learn how to accomplish my task. Or maybe if someone else is working on this we can work together to figure it out. I think that if I can find a way to make the camera stationary, the only thing that should move is the Player while in the room, THEN the tilemap when moving to a new room. Then the play shows up on the other side of the door.
I have tried so many variations of the below code for the zooming.
int viewX = (_tileMap.tileSize.width * 16);
int viewY = (_tileMap.tileSize.height * 12);
[self.camera setEyeX:viewX eyeY:viewY eyeZ:0];
I have tried some promising variations on the transition effect
[_tileMap runAction:[CCMoveBy actionWithDuration:0.6 position:ccp(0,viewY)]; //if moving up
[_tileMap runAction:[CCMoveBy actionWithDuration:0.6 position:ccp(0,-viewY)]; //if moving down
etc…
I just keep coming back to the boundary and view problems
Any thoughts or suggestions or links or youtube videos would be greatly appreciated!!!
Thanks for listening to me plea for help