map is working again

Added a better implementation for the map. However I still need to clean
up the shutdown of the game. Not all resources are cleaned up properly.
There is another problem: if the screen is bigger than the map, the game
will crash.