|
-
Aug 12th, 2000, 02:00 AM
#1
Thread Starter
New Member
In a game I'm working on, all of the levels are picture boxes named (tile) with an index array. There are (I think) 50 across by 50 tall. They will be assigned a texture, and whether or not aplayer can move across/on top of them by there tile(x).tag property. I was wondering, how I could make a file that would be simlar to this:
1,1,1,1,1,1
1,0,34,0,0,1
1,0,0,0,0,1
1,0,142,0,0,1
1,0,0,0,0,42,
1,1,1,1,1,1
And then load each number to the tile(x) property. Thanks a lot in advance for any help
If I weren't insane, someone else would be. :-p
Steve
-
Aug 13th, 2000, 10:54 AM
#2
Monday Morning Lunatic
Loop through each line, and split it up. Then put them into the right place in a 2D array. ie, use a tile(x,y)...or is it tile(x)(y)? That should help.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 13th, 2000, 11:16 AM
#3
PowerPoster
If you level is an array (the indexes) you can access the file binary like this:
Code:
Dim Level() as Long
'Initialize the level array
Redim level( 50, 50 )
'Write the array tro file
Open File for binary as 1
Put 1,, Level
Close 1
And to read:
Code:
'Read array from file, note that
'it has to be exact size as you
'saved it (50x50)
Open File for binary as 1
Get 1,, Level
Close 1
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
|