TileMap .MAP files
by Kevin French · in Torque Game Builder · 03/13/2007 (8:47 pm) · 1 replies
I've just recently picked up TGB (have TGE for a long time now) and during my course of study one of the effects I want to do (based on past success) all refer to loading a .MAP file for a tile map.
I've used the editor to create a tile map but it saves as a .LYR file. I figure a .MAP file is a collection of .LYR files?
I've looked everywhere in the editor for creating a .MAP file. Are these still in use by the engine? If so, how do I go about creating one?
And if you are curious, I'm trying to create a background image that scrolls as the player moves for an endless world. A space background for example.
I've used the editor to create a tile map but it saves as a .LYR file. I figure a .MAP file is a collection of .LYR files?
I've looked everywhere in the editor for creating a .MAP file. Are these still in use by the engine? If so, how do I go about creating one?
And if you are curious, I'm trying to create a background image that scrolls as the player moves for an endless world. A space background for example.
Associate David Higgins
DPHCoders.com
%map = new t2dTileMap() { }; %map.createTileLayer(....);Something like that, the TGB Reference has a complete list of Tile Map and Tile Layer functions exposed to TorqueScript ... and theres even more power behind them in C++ (some things you'd think are available, are not unless you write a new console method that exposes them)
As for a scrolling background, you could use a Scroller, which is just a series of images slapped together to create the illusion of a never-ending view ... look at the ScrollerDemo for an example of a REALLY LARGE scroller ... given the right artwork, and a well built scroller ... I could see it working as an infinite space thing ... randomly dropping planets and moons in places or at specified coordinates. you could keep track of the players "relative" coordinates by ticking down using a timer ... rather then moving the player sprite, for example, just set a timer that goes off like every 250-500ms and subtracts 1 from whatever axis it should ... or possibly even a floating point value determined by the players rotational angle ...
as for the scroller ... I believe you could have the scroller setup to scroll infinitely in one direction, then just rotate the scroller with the player object, so it appears as though the player is rotating and the 'space' keeps scrolling ... might take some playing around with ... but it should work ... I think ...