I had a similar problem a few weeks ago.

I was playing any game and suddenly my PC would shut off and restart when the game loaded and have slowdown, or after playing briefly.

For me it was my Power Supply.

I think if the symptom is *sudden shutdown without any computer lockup* it is most likely your power supply.

If you get a long lock up and laggy input on your computer for a while and/or a BSOD, then it is probably a RAM thing.

Check another Power Supply if you have one around, or maybe even using different wires from the Power Supply and to your other components like motherboard and hard drives.