Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Pong AI
- Patrickwitt2285
-
4 posts
Pong AI
Hello I am making a Pong Game for my computer science game, and I need help with the AI. How do I make the AI follow the ball?
- lederniersamourai
-
500+ posts
Pong AI
You can use the starter project made y the scratcher team to understand how pong works
http://scratch.mit.edu/projects/10128515/
In the aumatic plyer, you should put a forever with a set x to te value of the x of the ball
Then you have to weaken your automatic player with one of more artefacts:
1) add some small delay with wait 0.' secs or less
2) move the x position of the utomatic plyer with a random number around the x position of the ball
http://scratch.mit.edu/projects/10128515/
In the aumatic plyer, you should put a forever with a set x to te value of the x of the ball
Then you have to weaken your automatic player with one of more artefacts:
1) add some small delay with wait 0.' secs or less
2) move the x position of the utomatic plyer with a random number around the x position of the ball
Last edited by lederniersamourai (Sept. 26, 2014 17:12:37)
- 223969
-
16 posts
Pong AI
if y position of ai less than y pos of ball than change y by 10
if y position of ai more than y pos of ball than change y by -10
if y position of ai more than y pos of ball than change y by -10
- Zizzle8383
-
100+ posts
Pong AI
Please dont necropost, this is from 2014 make your own topic if you need help.
Last edited by Zizzle8383 (July 2, 2019 01:22:42)
- deck26
-
1000+ posts
Pong AI
Why are you commenting on a post from 2014 though? Please don't necropost.its trash This would be a simple way to make it move:
- marktestep
-
1 post
Pong AI
why are you responding to a response responding from a post from 2014
- ProgramingBeginner
-
74 posts
Pong AI
Because necroposting is not allowed! why are you responding to a response responding from a post from 2014
- N3rdyPineapple
-
1 post
Pong AI
add a forever loop around the whole thing and it will work
- Redcarred2_2
-
4 posts
Pong AI
It only sometimes works, but
Then After that
Then After that
Last edited by Redcarred2_2 (Oct. 8, 2019 22:01:07)
- kooldoofus
-
3 posts
Pong AI
This might be a bit late. Also this is my first post so I really don't know how to do this.
Hope this is helpful!
This is an example of this made by my friend. If there were no glitches, it would be impossible to score against AI. But it can be used for like a training in a game
Last edited by kooldoofus (Dec. 18, 2019 00:47:43)
- FallingTower
-
2 posts
Pong AI
Why are you commenting on a post from 2014 though? Please don't necropost.its trash This would be a simple way to make it move:
- jacobitsme3
-
1 post
Pong AI
yey look at this conversation (this wont help ok)
Last edited by jacobitsme3 (Sept. 9, 2020 19:56:37)
- duhmp
-
1 post
Pong AI
there put a forever around it and your good to go it was two negatives one should have been positive This would be a simple way to make it move:
- diamondwolfy011
-
4 posts
Pong AI
there put a forever around it and your good to go it was two negatives one should have been positive This would be a simple way to make it move:
- Discussion Forums
- » Help with Scripts
-
» Pong AI