Results 1 to 3 of 3

Thread: Tiles, textures, text

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Chicago
    Posts
    6

    Cool

    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

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  3. #3
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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
  •  



Click Here to Expand Forum to Full Width