🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
pong ai
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.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement