update width and height when generating map
collisions with map borders