Dungeon exploration game bug: no output

Thank you for looking into my code. I manage to find out where the problem is. When I remove the last part where the mouse click isused as input so that the room is updated, the program work just fine (just without the ability to have any sort of input as it stays in the draw loop)