Results 1 to 3 of 3

Thread: Maps

  1. #1

    Thread Starter
    Lively Member Spie's Avatar
    Join Date
    Jul 2000
    Location
    On a very small coconut somewhere near Mars
    Posts
    126

    Question

    How do I create a map file? I need to stop a picture from going off the form... do i need a special program to do that?

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Oh boy, this will be a long thread. You need to store the map in a 2d array. And then I guess just save the array as .map

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Yeah, that's what i think Steve, ok let's start from the beginning...

    For the map, you declare the width, the height and the map array
    Code:
    private height as integer
    private width as integer
    Map() as byte
    The map array is now dynamic so that you can change the size of it anytime:
    Code:
    height=30
    width=30
    redim map(width,height)
    To store this array you open the file in binary
    Code:
    Open Filename for Binary as #
    Put#1,,width
    Put#1,,height
    Put#1,,map
    Close 1
    And to read it again you use Get isntead of put
    Code:
    Open Filename for Binary as #
    Get#1,,width
    Get#1,,height
    Redim map(width,height)
    Get#1,,map
    Close 1
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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