Why is my laptop not charging when I play games?

Well i dont get what is happening, no its not a new laptop and that may be the problem but i changed the charger and nothing, i take the battery out and when i turn a game on the computer just turns off i even tried to turn the laptop brigthness screen to the minimum to see if the charger for some reason stoppedhaving thepower to charge the laptopbut thats not it the charger is new and the computer stops charging but not only charging, when the game menu appears its like the same as saying there is no charger plugged in the laptop, because i have no power going to the laptop when gaming but if i look at the laptop the led that the computer is plugged in is on and its true the laptop its plugged but it is not receiving energy do you guys have any idea of what can be the problem? BTW if i unplug the charger when gaming and plug it again the computer starts charging but only for a few seconds and stops again, if i shutdown the laptop it has no problems charging, but even when its on sometimes it stops charging even if im not playing any game or not doing anything at all.

Sorry if i wrote something wrong english is not my native language thanks.