you'd have to use something other that something that slows down the entire game, like a separate (second) algorithm that makes the paddle miss track the ball so it misses it every so often. Then goes back to the primary algorithm that keeps track of the ball.
Or one algorithm that has a burp in it so it miss tracks the ball every so often while running.
IE, during the following of the ball, it loses it, it could move quickly up or down making it look like it was trying to put a spin on the ball but misses the ball instead.
Think of real life situations of racket ball even in terms of how one hits the racket ball with the paddle, then try to put that into a programming language within your game to imitate real life. AI
Last edited by userxbw; 12-11-2017 at 07:28 AM.
One of the main difficulties is the OP only began programming "2 days ago", yet apparently they have "tons of it with many different libraries.", not to mention the added difficulty of "i'm programming a microcontroller".
My guess is, they "found" a whole mess of code just because it implemented what they want, but it far outstrips the original requirements (them been an ultra-noob and so on), and they have no clue whatsoever how to proceed.
The fact that post#17 happened (again) when I'd already explained the problem in post #7 shows they're not really up to the task.
@OP, if this is an accurate description, then throw away your found code and concentrate on implementing your requirements in your own way at a skill level appropriate to you.
Not to mention the comical suggestions of "dos.h" and "unistd.h" when it was already established that the OP is "programming a microcontroller".
This stumble-fest is over 60 replies long ffs.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.