The first thing you could try is updating your graphics drivers. Search the intel site for a driver update for HD 4000(m). Another possibility is that your computer is overheating, I had the same problem with trying to play games on an old laptop before.
Thanks man. I updated my graphics driver just like you said. Also went and got myself a laptop fan. Now my games are working just fine. Thanks again.