Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / 3d pong paddle A.I.

Author
Message
Tone3e
19
Years of Service
User Offline
Joined: 17th Feb 2007
Location: here
Posted: 22nd Mar 2007 00:48
So I made a 3D pong game and both paddles have to be controlled by someone. I wanted for one of the paddles to be able to move by itself. The ball's z and x coordinates are in variable form as well as the paddle's z position. I would appreciate any help as this is the first time I ask for it. I try to do everything myself, but I cant find a way around this. Thanks for any help.

Future programming master.
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd Mar 2007 01:55
Each time you move the ball, you have it's Z position. All you need to do is move the computer's paddle towards it.

If the ball is moving a little faster than the speed of the paddle then there's a possibility for the paddle to miss.

If the paddle is the same speed or faster than the ball then the paddle will never miss and the game will be unbeatable.

TDK_Man

Login to post a reply

Server time is: 2026-07-05 22:39:14
Your offset time is: 2026-07-05 22:39:14