So I'm starting to learn Java and some OpenGL while using the LWJGL. To start off easy, I'm writing a clone of the Atari Pong. I got set up correctly the game screen, collision detection, and all the game is mostly working, actually, if it were a 2 player game I'd be done by now, but as I'm planning on doing this a single player game, I have to come up with a simple AI to control the second player.
Knowing where the ball will hit seems fairly trivial, and creating an AI which always hits the ball seems like an easy thing to do, but I want the game to be able to be won, so I can't always make the IA hit the ball.
So here's my question, how should I code this to add human-like imperfections to the AI. Should I randomly decide if the AI is going to fail at a given point? Or there's an smarter (or maybe just obvious) thing I'm missing here?
Thank you very much.