Game Development Community

Rotating a Tile Map

by Leon · in Torque Game Builder · 01/09/2007 (5:54 pm) · 1 replies

It's possible to rotate a tilemap? So in a game when you push a button the floor will convert into the ceiling or the walls will convert into the floor.

If not, Is there any way to work around this problem?

#1
01/11/2007 (5:00 pm)
I believe that t2dTileMap is a t2dSceneObject just like anything else, and can have arbitrary rotation just like any other scene object.

From what I remember of the code when I was reading it to try and do my own isometric tile map, I seem to recall seeing a fair bit of code to deal with the ball-of-hair that is dealing with rotated tiles.

AFAIK, just rotating the tile map normally should work fine.

MyTileMap.setRotation(180);

Sorry if I've led you astray, but I'm about 70% confident that I'm right about this.

--clint

Edit P.S. You may have to do some hackish little code in order to move your player to the new appropriate spot after you've rotated the tile map underneath him so that his new location corresponds to his old one, since he probably won't always be at the center of the map when you flip his gravity.