2d side scroller approach with TGB
by Bruno Patatas · in Technical Issues · 11/17/2008 (10:01 am) · 2 replies
Hello there,
I'm planning to do a 2D game with Torque Game Builder (TGB).
The map of the game will be circular, this means that from a start point if I move right(or left) after some time will be at the exact same spot. My idea to do that type of movement is when the camera hits one of player's world limit it will set the X position on the other side of the world limit.
The map will have a variety of background images that it'll side-scrolled at different speeds but ONLY when the player moves. This is what differentiate this type of scroller from the ones of the tutorials that I made.
After some tries I saw some possibilities:
1)Put the different type of background on different Tile Maps,set the Wrap X option and when the player walks apply an AutoPanX value.
2)A Static image for every background with a smaller or larger size (depending on the speed I want to apply to the background) than world's size and with some math moving it when player walks.
3)I didn't try this one but I think it'll work like option 1). Using a scroller and when player moves set the scroll speed.
So my questions is what approach it will be better or I have to use any other approach? And for this type of circular world the best solution is to teleport the player from one world limit to the other?
any ideas? :)
thanks in the advance
PS: I'm a newcomer here, dunno if this is the right place to this topic.
I'm planning to do a 2D game with Torque Game Builder (TGB).
The map of the game will be circular, this means that from a start point if I move right(or left) after some time will be at the exact same spot. My idea to do that type of movement is when the camera hits one of player's world limit it will set the X position on the other side of the world limit.
The map will have a variety of background images that it'll side-scrolled at different speeds but ONLY when the player moves. This is what differentiate this type of scroller from the ones of the tutorials that I made.
After some tries I saw some possibilities:
1)Put the different type of background on different Tile Maps,set the Wrap X option and when the player walks apply an AutoPanX value.
2)A Static image for every background with a smaller or larger size (depending on the speed I want to apply to the background) than world's size and with some math moving it when player walks.
3)I didn't try this one but I think it'll work like option 1). Using a scroller and when player moves set the scroll speed.
So my questions is what approach it will be better or I have to use any other approach? And for this type of circular world the best solution is to teleport the player from one world limit to the other?
any ideas? :)
thanks in the advance
PS: I'm a newcomer here, dunno if this is the right place to this topic.
#2
11/24/2008 (6:21 pm)
Very cool sounding project! I'd recommend asking this on the TGB public forums. You'll most likely get a better response there.
Torque Owner Brian Wilson
If I ever go back to that project and pick it up again, I'd probably use a mounting system to mount each component onto a master hub for each layer. Then rotate each layer relative to a master hub. It's certainly more work to put the world together rather than making repeatable tile-maps, but that's simple what would work for the application I have in mind.