In my game I have 2 players, 1 is controlled by a human and the other by the cpu. They throw a bomb back and forth across a line in the middle of the screen,( I plan on randomizing the exploding times of the bomb: 3 to 5 seconds), if the bomb reaches the far edge of the screen, the other side gets an extra player that is attached to the first player and the 2 move in unison.
When one player fills their side(from middle line to screen edge) they win. The extra men that come out will be able to die if that side holds the bomb too long and it explodes, killing the last man that came out. Also, if the player is too far from the line in the middle of the screen the bomb will not clear the line, making it bounce back onto the side of the player that threw it and increasing the chances that it will explode on that side. Kinda like tennis or volleyball.
How would I make sure the CPU player does not cath the bomb before it bounces to the sceens edge everytime? In otherwords: A human player may miss the ball every once in a while. I'm thinking the CPU player may catch it every time. Am I correct in this thinking? And, How would I randomize the CPU player time on holding the bomb?
Thanks for any help.