You and your friend are sitting in the study room of the library. You are doing your homework and he is playing next to you. Someone came to talk to him and watch him play games.
Personally, I think everyone has their own hobbies and lives. There is no need to force him to stay with you all the time. Even the best friend, don't deprive him of the space to make friends in life. He knows you are studying, so he won't bother you. He respects you, so you should also respect his hobbies. Don't be petty and unbalanced. When he talked about games, it showed that they were all interested. You should be happy for your friends. Making friends is not selfish.