Results 1 to 7 of 7

Thread: [Resolved] maps for 2d games

Threaded View

  1. #1

    Thread Starter
    Fanatic Member McCain's Avatar
    Join Date
    Jan 2002
    Location
    Sweden/Denmark
    Posts
    802

    [Resolved] maps for 2d games

    I'm trying to use a simple map writen in a txt file in my game but I can't get it to work.

    I have an array of integers: int iMap[10][10];
    And then I read in numbers from a txt file useing for loops and useing iMap[x][y] = fin.get()

    Here's my problem; When reading the file like this it puts all tbe '/n' in the array as well so I have to have the whole map on one line in the txt file. I would like to have it 10 by 10 in the file as well. How can I tell fin.get() to ignore all linebreaks in the txt file?
    Last edited by McCain; Feb 17th, 2003 at 07:18 PM.
    Never argue with fools, they will only drag you down to their level, and beat you with experience.

    Q: How do you tell an experienced hacker from a novice?
    A: The latter thinks there's 1000 bytes in a kilobyte, while the former is sure there's 1024 meters in a kilometer

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