File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Computer Pad Not Stopping! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Computer Pad Not Stopping!" Watch "Computer Pad Not Stopping!" New topic
Author

Computer Pad Not Stopping!

Martin vanPutten
Ranch Hand

Joined: Mar 26, 2006
Posts: 124
Justin... maybe you can help me. I have it set so when the ball hits the borders the computer pad will follow it so that it won't lose and miss the ball, but when the ball hits the bottom border, my timerAI.stop is not working and it stops afterthe ball hits the ground. The pad width length is 80 and the balls is 26, so the pad will show to the point where only 26 of its length is showing then continue to follow the ball. How can I get it to stop at 500?




Live And Let Learn.
Martin vanPutten
Ranch Hand

Joined: Mar 26, 2006
Posts: 124
Or... a better idea... how would I go about creating a real AI where there is flaw for the computer pad to miss?
Martin vanPutten
Ranch Hand

Joined: Mar 26, 2006
Posts: 124
Does anybody know how I can create an artificial intelligence of some sort for the computer?
Martin vanPutten
Ranch Hand

Joined: Mar 26, 2006
Posts: 124
So I managed to get the pad to stop. But I can't get it to go back again without moving down off of the border. Heres the new code:


What do I have to do? I've tried everything I know of.
Jon Mattson
Greenhorn

Joined: Feb 07, 2006
Posts: 19
Well i don't really understand what u want but here is what i did. Now the computer stops when it hits the wall. I don't think it's a good idea to use timers for this. I think a game loop would be better. Also you should fix that flickering by drawing everything to an off screen image and then drawing that image to screen.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Computer Pad Not Stopping!