This game represents physical calculations based on time based animation. It also incorporates collision detection between the puck with the paddles and the walls.
Once you have gotten used to moving with the paddle, simply try to block the puck from entering your goal and try to hit it into your opponents. In real life, air hockey machines have numerous holes in the surface of the table that blows air up. As a result, the puck will glide and move faster. So beware of how fast the puck may come.
For practice, you can try hitting the puck with the AI turned off. You can then turn on the AI whenever you want, as well as reset the position of the puck and restart the game itself.
The AI checks to see if the puck first has crossed on to its half of the playing field. If it has, then it checks the distance between the paddle and the puck. If it is within a given range, it moves towards the puck. If it is not, it moves back to its initial position. The force applied to the puck will always be constant with the AI, and in this case, the AI hits it pretty hard. To make sure the AI wasn't completely unbeatable, I made it a bit weaker on one side. When playing, you can see that playing to the AI's right side will mean there's less of a chance of the AI getting to the puck than its left.