|
-
Mar 11th, 2000, 01:37 AM
#4
Member
Okay, well,
The map is basically an array, either 2d or 3d, etc...
so you set it up :
private Grid(1 to 100,1 to 100)
theres a 100x100 grid
each element is given a number, either manually ie:
Grid(1,1)=1
or you can write an editor program, which is a little long to copy here
Each number represents a tile. ex 1 = grass
Then its just a matter of checking each element to find out what number it is and draw it appropriatly.
I'm working on a game (as a learning experience) which uses a similar setup.
I read/write the grid to a txt file , using a straight forward loop:
For x= 1 to 100
for y= 1 to 100
[Input/Write]#1,grid(x,y)
next y
next x
then I've got functions which compare grid(x,y) to where the player is (for terrain dependant events)
and where the players going (for impassable areas,etc)
If you want to see the whole code email me - [email protected]
the game as it is, i've got at www6.50megs.com/seanm,
I hope that helps a little...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|