Game Development Community

Tile wrapping problem

by Eric Summers · in Torque Game Builder · 03/21/2006 (1:30 pm) · 1 replies

I was attempting to use one large tile as my background image for my project. This one tile was also scroll beneath the player. I had assumed this would work cause this was basically what they were doing in the tutorial (although they used a "real" map with multiple tiles in it where I am using a map with one tile that is as big as the screen).

Here is the code I was using

function CreateBackground()
{
//Create our tile map object
%backgroundMap = new t2dTileMap() {scenegraph = t2dScene;};

//Load tile map file
%backgroundMap.loadTileMap("~/data/tilemaps/groundmap.map");

%backgroundLayer = %backgroundMap.getTileLayer(0);
%backgroundLayer.setArea("-50 -37.5 50 37.5");
%backgroundLayer.setTileSize("100 75");
%backgroundLayer.setWrap("true true");
%backgroundLayer.setAutoPan("0 20");

}

So when I run this, the background tile correctly covers the entire screen, and it scrolls, but it doesn't wrap. So in about 5 seconds the player is in empty space.

Do I need to use a "real" map to get this effect (multiple tiles instead of just one big tile)?

Thanks in advance,
Eric

#1
03/22/2006 (6:34 am)
Never mind, I found the docs on the scroller object, and that is doing what I need :)