Game Development Community

Issues with Scrolling Tilemaps

by Christopher Franklin · in Torque Game Builder · 09/23/2008 (7:56 pm) · 1 replies

I'm having a wacky issue when wrapping scrolling tilemaps and having them collide with sprites.

I essentially have a tilemap with select tiles that have collision turned on scrolling downwards towards the object I want them to collide with. Think Guitar Hero - four columns and a big object they're colliding with at the bottom of the screen. The issue I seem to be having is that either collision breaks or the tile position resets after about a single complete wrap around.

If I leave the starting tile position at 0, 0 then after about a single complete wrap the tilemap's position will jump backwards about halfway. I.E., if there's just a single node at the top of the screen when the game starts, it will reach the bottom of the screen, start to wrap around to the top, and then teleport back to about 2/3 down. From then on it works perfectly.

If I set the starting position of the tile layer to be 0, -768 (the height of one tilemap) it will wrap properly. However, it will now collide with the object at the bottom of the tilemap halfway down the bar (when they're nowhere close to touching) on the first trip down. After that first trip, it seems to work 100% fine.

Anyone have any idea what could possibly be causing this?

Edit: It only seems to happen when the tilemap has a negative Y autoscroll - scrolling up seems to work just fine.

#1
09/23/2008 (8:02 pm)
It seems like it might just be a problem with Torque itself - I tried starting a new project in the TGB, added a single image, created a tilemap with a single tile of that image, and set the velocity to -20. After about a rotation the visible tile teleported.