• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Computer Pad Not Stopping!

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?


 
Martin vanPutten
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anybody know how I can create an artificial intelligence of some sort for the computer?
 
Martin vanPutten
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
This is awkward. I've grown a second evil head. I'm going to need a machete and a tiny ad ...
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic