Sign in to follow this  

Big tile maps

This topic is 4747 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have tried tiling some small maps by hard coding the maps with numbers which represent the different types of tile. I thought of trying to tile big maps but i guess it will be quite tedious to hard code big maps. Can anyone offer any advice how to tile big maps efficently? thanks in advance for any advice

Share this post


Link to post
Share on other sites
Make your self a mapeditor, write it in Java, C# or VB so you can get it done nice and quick.

Split the screen into 2 the left hand 2/3rds of the screen is a grid of blank squares with its X,Y specified by the user at start up. the right hand 1/3rd shows the tilemap (bitmap with your tiles on). Also make the user specify the tile size on startup.

Give both windows scrollbars when the user clicks on a square in the tile map the program makes that tile the "brush" and also logs its position on the map as:
point at mousedown[(int)x/tilesize,(int)y/tilesize)] this will give you the row and column of the tile clicked on,remember to cast them to integers to get rid of any floating points. Next paint the tile on the sqaure the user clicks on in the blank grid.
The blank on screen grid represents a 2D array defined at start up that has as many elements wide and high as the map is TILES (not pixels) wide and high.
When the user clicks on a blank tile in the leftwindow with a brush selected get the: point at mousedown [(int)x/tilesize,(int)y/tilesize)] to get the row and column of the array.
now just write the loggeed x,y from the tile map into x,y co-ord on the array.
When the user is done and clicks save stream the data out of the array into a text file in the manner you will be reading it back.

There you go, a simple map editor with a front end that stores the map in a text file your program can read into an array.
at a later date you can add "paintable" collision data to the choices of your editor, etc.

Share this post


Link to post
Share on other sites

This topic is 4747 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this