I'd like you to explain to me the use of the gerund in the following two sentences.I included other sentences I'm not sure of.
1) One day, Prospero's frieds are having a party. They only stop when the pendulum is striking the hour.
2 The protagonist is thrown into a dark dungeon. He explores it and finds out that its shape is square and has a deep pit in the middle. The wall is covered with iron and with horrible figures.
3) Can you say "The protagonist is on the brink of a pit?"
4) At midnight a strange man with (or in??) a red costume and a death mask turns up and scares everybody.