My iphone 3GS suddenly shuts down i have a nice iPhone 3GS which has a curious behaviour.

I'm not using it often but when i'm doing CPU intensive things like a game, it just shuts down suddenly, screen becomes black an i can't restart it without putting it on the charger. It's not hot.

Then i plug it, and it just boots and is runs ok with the same battery level as before the crash.

I thought changing the iOS would fix that but it doesn't .. i'm on iOs 6 and it's still the same behaviour

What could i do ?
thanks
Sometimes when you run some games that is not compatible with your iPhone, it will use more power than it can to the CPU and GPU and then it will crash. Try to verify if the game is compatible with iPhone 3GS