So, my partner and I are trying to make a pong game that is against the computer, but we just could not figure out how to make the computer lose.
We already have the basic material, and it works great, but the computer just does not lose. And we also tried to slow down computer trading using sleep, but whenever the oar moves slowly, the ball also moves slowly.
any advice will help! Thanks
And we also tried to slow down computer software using sleep, but whenever the paddle moves slowly, the ball also moves slowly.
You need to make it slower by moving it a shorter distance each time it moves.
"" , , , . , , , , .
, , , , .. , , - .
, , "", . , ?
, , , "" " " , , , . " 1, 1, 1" " 1, 0, 0, 1, 0, 0..." - .
, , https://gamedev.stackexchange.com/. , AI. . ( , .)
, . - . , . , .
. , , . , .
. , , .
(, , ), .
( 1), .
When you use Sleep, the entire program stops for a few milliseconds. Do you have a game loop? If so, try reducing the transfer amount and do not forget to normalize the acceleration vector.
cpuPadlle.Position += amount * acceleration;
Where: