Advertisement

tle based engine help

Started by November 24, 2000 09:25 PM
0 comments, last by OoMMMoO 24 years, 1 month ago
Can someone help me? Im having trouble with making a tile based engine. How do you make a map from a .txt file and how do you tell if a tile is walkable or not?
There are absolutely LOADS of tutorials on this out there on the net (and here on gamedev), but you want actual help, so here goes.

The easiest way of doing this is to have a simple text file like this:

10, 10, 02, 10, 10
10, 02, 02, 02, 10
10, 02, 02, 02, 10
10, 02, 02, 02, 10
10, 10, 10, 10, 10

You also have a map like this:
int Map[5][5]

You then just read the values into the map array one at a time.

As for the second question, the easiest way is to check when you move the player if the new tile is walkable or not basd on the value, eg.

Player::Move()...if (NewTile > 9)    //move playerelse    //don''t move player... 


Make sense?

Waassaap!!
Waassaap!!

This topic is closed to new replies.

Advertisement