|
Tile based game help |
Fishcake
Member #8,704
June 2007
|
im new in c++ programming and i just finished making a tic-tac-toe game with AI. http://agdn.netfirms.com/main/html/tut_2.htm but i dont understand the load map part. what does map.cell contains?
|
23yrold3yrold
Member #1,134
March 2001
|
Right near the beginning of the code: #define GRID_WIDTH 15 #define GRID_HEIGHT 15 typedef struct WORLD { unsigned short cell[GRID_WIDTH][GRID_HEIGHT]; } WORLD; WORLD map; So map.cell is a 15x15 array of numbers. After loading it contains the ID number of each tile of the map. -- |
Fishcake
Member #8,704
June 2007
|
ok, i understand that part, thanks now i found these at http://awiki.tomasu.org/AllegroTileMaps
can anyone write a simple code using these? a complete code that just draw 20x15 map loaded from a text file (no other stuff like scrolling, movement, etc..), with 2 different tiles and 2 layers. none of the tutorials i read actually helped me, so maybe i can understand it by this way. i don't think its too much for you guys, or is it?
|
DanielH
Member #934
January 2001
|
They didn't help or you didn't read them? What you need is really simple. You should take the time to think about it. But ... 1st. What size map would you like? As to your question about load map. Each cell contains an integer value of the tile in the datafile. From drawmap There are 256 tiles. p is from 0 to 255. I'd explain this more, but do a damn search on these forums. I've explained this more than once before. |
23yrold3yrold
Member #1,134
March 2001
|
Quote: i don't think its too much for you guys, or is it? Well, that was rude. Quote: none of the tutorials i read actually helped me, so maybe i can understand it by this way You posted links to two excellent Allegro tilemap tutorials that have everything you need to know to do what you asked; you'd better learn to understand it this way or you're not going to learn much else without forum begging. It's giving a man a a fish vs. teaching a man to fish; sorry. Take an honest shot at it yourself, and post your work if you have trouble getting it to work. -- |
Fishcake
Member #8,704
June 2007
|
23yrold3yrold: oops, sorry. didn't mean to be rude thanks for answering! DanielH: i think its too early for me to mess with tile based engine. i dont understand the class and struct part. can't figure out how to actually use them. yea, about the load map, i got it already. and i did do a damn search on the forum for the past 3 days. and yes, i found it
|
|