code improvements

changed the tile class into a struct
tileengine now handles the tiles