I read the map from a file being just numbers that represented a different sprite but one couldn't describe an object on those tiles.One way to do this: instead of using the numbers to refer to images, use it to refer to an object description. Don't think of tiles as something that is not an object. Just think of tiles as objects whose positions are snapped to a grid. That means the ground brick is an object, the question brick is an object, and so on.
For example, I can have a map description file like this (ini-like format):
[level 1] tiles = A A A B AAAA A = "brick" B = "player"
In this example, the value of "tiles" describes the placement of objects in the map. The symbols 'A' and 'B' are tiles, and they point to an object description, not an image file. When loading the map, just read in the symbols of "tiles" and see what object each of those symbols refer to, and use the refered object description to load in the object, and set the object's position according to some loop state variables you keep.
Now how do I parse this? I can read the file and translate those letters to tiles, however this does not help me translate the position of those letters to position of tiles in the world.
For instance, this is the map I have
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
And while I can instruct my code to treat the letters as tiles, at the moment I do not know how to position the tiles as per the map.