Dungeons were broken up into rooms. Sometimes doors would close behind you, trapping you in with the monsters you needed to defeat. Other times, you had to solve a puzzle to get through. Or try and find a key to get through those pesky locked doors.