Secondary display turns off when I close the flap of my MacBook pro running on High Sierra I wanted to play some retro games, I connected a ps3 controller so that i could play on a big screen.
As soon as I close my MacBook pro's flap, monitor also mirrors it.
I saw on youtube that a person was using the mac and he closed his flap, but everything was running fine.
The mac has to be plugged in for it to still work with the lid closed.

If you have a USB-C power port, you may have to unplug the cord from both the MacBook and the brick, and then plug it in again. Sometimes it comes loose on one of the ends