Computer Science Canada Reading .TXT RPG "Maps" and tiling them correctly. |
Author: | MiX-MaztA-M8riX [ Mon Sep 19, 2005 5:15 pm ] |
Post subject: | Reading .TXT RPG "Maps" and tiling them correctly. |
I've got the proggy to identify the tiles and stuff.. like 1 = land, 3 = water, stuff like that.... but how can I get it to draw the pictures normally? instead of on top of eachother everytime? Im stumped, any help would be greatly appreciated ![]() |
Author: | beard0 [ Mon Sep 19, 2005 5:33 pm ] |
Post subject: | |
Please be more specific and post some code, then we can help. |
Author: | MiX-MaztA-M8riX [ Mon Sep 19, 2005 5:39 pm ] | ||
Post subject: | |||
sorry aboot that
I know the LocX and LocY are always the same.. but how would I make it so it draws ten tiles from left to right, and goes down a row, then does it again |
Author: | beard0 [ Mon Sep 19, 2005 5:51 pm ] | ||
Post subject: | |||
Try playing around with this a bit, and figure out how it's doing it:
|
Author: | MiX-MaztA-M8riX [ Mon Sep 19, 2005 6:14 pm ] | ||
Post subject: | |||
wow, confusing enough? I got something thats working well for me...
it works pretty well ^_^ thx for the help.. but I'm not 1337 enough to fully understand your version ![]() |
Author: | Carino [ Mon Sep 19, 2005 6:26 pm ] | ||
Post subject: | |||
Its simple really if you understand 2D Arrays. All you do is load the map from the file say into an array called map[rows,columns] So from there all your coordinates are stored such as 1 = land, 2 = water, etc. Then you write a simple algorithm to draw the map such as:
Its easy once you ge the hang of it. |
Author: | MiX-MaztA-M8riX [ Mon Sep 19, 2005 6:35 pm ] | ||
Post subject: | |||
I think I'm doing summin wrong again ![]()
:: EDIT :: nvm I got it it seems the array was 1 .. 4 as I had numbers coming in as zero, so I needed 0 .. 4 ![]() |
Author: | beard0 [ Mon Sep 19, 2005 6:56 pm ] |
Post subject: | |
Well, you're not using the number 2, so unless you're planning on adding it soon, you should really use either 0-3, or 1-4. You really shouldn't have that 2 in the middle doing nothing. |