limit framerate
simplify logic
make TileManager non static