Sign in to follow this  
phil67rpg

pong ai

Recommended Posts

I am building a very simple pong game using dx9 and c++.I want to build in some AI for the computer opponent.This is my first time working with AI and I want to know where to begin.I am new to this so go easy on me, please.

Share this post


Link to post
Share on other sites
well, just think, what do you do when the ball is above you?, what about below you? that about sums up the ai for pong, with an extended possibility of doing ball prediction to create an unbeatable ai.

Share this post


Link to post
Share on other sites
My pong ai:

When the ball is moving away from the computer, move back to the middle
When the ball is moving towards the computer and is over halfway, align the centre of the paddle with the centre of the ball

Gives pretty solid AI and is coded in < 20 lines.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this