First time really start to learn C++ with SDL, I decided to start a very simple game to practice, I choose Pong.

Pong
] Despite of it’s over simple design, it got me few hours to figure out how to code it, not a language problem, is the collision checking and bouncing calculation. After getting a buggy version of collision and bouncing mechanism up, is time for A.I, and this took most of my time.

Of course I can just let the A.I follow the ball, going up and going down, but the challenge lies when the ball getting faster and faster while the bat did not get speed boost. As a player, we don’t follow the ball exactly, before we even move the bat, we made a quick estimation where the ball will probably landed on, based on the estimation, we move the bat to the location accordingly.

This kind of simple decision making is giving me hard time for first time coding the A.I logic, it’s a good start for A.I thinking, hopefully I can manage it myself without much reference. :p