I used Deep Q Networks to create a model that can play custom games created through pygame.
DQNs are a combination of reinforcement learning and deep neural networks. They use neural networks to approximate Q values which is then used by the reinforcement algorthim to take action depending on the epsilon greedy strategy and maximium reward given for each action.
View More in-depth explanation here.