Game Development Community

Tile sizes & view limit

by John Coyne · in Torque Game Builder · 01/22/2006 (5:11 am) · 5 replies

Hi
I'm making an 8 way scrolling map for my game, on a map thats 2 screens tall and wide. Trouble is setting the view limit and the tile size, i'm not sure what the recommended tile size is, i'm using 10 just now. How do i figure out the tile size and number of tiles to get the correctly sized map, and how should i set the view limit. Just now it seems a lot of trial and error. Also, will there be problems later when someone using a different screen resolution runs the game?

#1
01/22/2006 (6:15 am)
It's all up to you. T2D's coordinate system is not dependend on screen resolution or anything.

You can set the area the camera view with t2dSceneWindow::setCurrentCameraPosition(%pos, %size).
E. g. you do SceneWindow2D.setCurrentCameraPosition("0 0", "100 75") and have a tile-size of 10x10 then there would 10x7,5 tiles be shown per screen. If you're tilemap was 20x14 tiles, that would be what you wanted.
You can then set the view-limit to the size of your map:
SceneWindow2D.setViewLimitOn( $yourTilemap.getTileLayer(0).getArea() );

It is always recommended that the width and height ratio of your camera is the same as the one of the t2dSceneWindow. Otherwise things will get stretched or squashed.
#2
01/23/2006 (4:22 am)
Thanks, thats a nice way to do it :)
#3
01/23/2006 (7:02 am)
Glad I could help.
#4
01/23/2006 (11:31 am)
For some reason getArea isnt working for me?
Is this a newer function?
#5
01/23/2006 (1:39 pm)
I think, it is available since t2d 1.1 alpha1.