Tile-based games!

This is a discussion on Tile-based games! within the Game Programming forums, part of the General Programming Boards category; I am making a tile-based game. I want to create a struct for the data from the level file. I ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Tile-based games!

    I am making a tile-based game. I want to create a struct for the data from the level file. I have this:

    struct TILE
    {
    int TEX; // Holds texture ID
    int *DIM; // Holds number of x, y tiles
    };

    how would I create a loop and use sscanf(); to extract the amount of x, y tiles. And then, get the numbers on each tile. For example:

    11111
    12221
    12221
    12221
    11111

    Any help is appreciated!
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    403

    when i did this...

    i designed my own file type (use binary output not ascii)

    something like this

    [width-unsigned integer]
    [height-unsigned integer]
    [each tile structure, starting with 0,0]

    then you just read in the width and height, create your array
    and start populating with two for loops
    pretty simple stuff once you get the idea of creating your own file type

  3. #3
    Registered User VBprogrammer's Avatar
    Join Date
    Mar 2002
    Posts
    175
    VC++ 6

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need testers for editor
    By VirtualAce in forum Game Programming
    Replies: 43
    Last Post: 07-10-2006, 09:00 AM
  2. Tile based game in opengl
    By Unregistered in forum Game Programming
    Replies: 1
    Last Post: 07-16-2002, 03:45 PM
  3. Tile Based Games
    By Unregistered in forum Game Programming
    Replies: 2
    Last Post: 04-03-2002, 08:55 PM
  4. 2d non tile based
    By DavidP in forum Game Programming
    Replies: 4
    Last Post: 02-01-2002, 12:51 PM
  5. tile based gaming
    By Unregistered in forum Game Programming
    Replies: 3
    Last Post: 10-27-2001, 01:17 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21