Using a pool table game as an example. How can I implement a computer opponent? I would like to have the computer try hitting the cue ball (white ball) in each of 360 degrees at 20 different levels of force. Then score the result of each of those attempts to decide which angle and force will have the best result, which the computer player will ultimately shoot.
If the computer runs through all of these scenarios using the same code as the manual player, in the same time it takes to make a shot, then it could take multiple minutes for the computer opponent to decide what shot to make. Considering there are 360 * 20 = 7200 scenarios to play out and score.
Is there a way to have each of the scenarios process invisibly to the human player as fast as the computer can calculate it, while using the same events that are already used to move the ball, detect collisions, redirect the balls, etc. for the human player?
..or is there a better way to approach this?
I have searched and searched, but my keywords have not found an article that addresses this. Please point me if this has been covered elsewhere.