If your computer is turning off automatically while playing a game this means your pc doesn't have enought system requirements to play these games and it's overheating! You will have to upgrade your computer components to solve this! Most games nowadays require a better performance such as better cpu and enough ram memory etc!!
Before you install a game just search about compatibility and system requirements of the game, on the net or on the DVD case