This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-07-29 15:58:42

gfchll
Scratcher
Registered: 2012-04-21
Posts: 100+

pong

I want to make a player vs. computer pong game(using the one in the examples in the program)how would you script the computer sprite?


HELLO EVERYBODY!

Offline

 

#2 2012-07-29 16:11:05

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: pong

Maybe you could have it so that the computer AI picks a number between 1 and 20, and If it picks a number above 2, it will go and hit the ping-pong ball. If it picks 1, it will stay where it is. The computer AI will pick between 1 and 20 every time the ping-pong ball is heading towards it, or you can have it do this every time the ping-pong ball is hit. You can also make it pick between 1 and 30 to increase the difficulty, or make it 1 and 100. You get to set the difficulty wherever you like, though occasionally, you can beat the Computer AI relatively easily, even when it is picking between 1 and 909,909. You could also increase the ping-pong ball's speed to increase the difficulty.

I'm sorry that I didn't provide the script itself, but I hope that this outline of a script helps you!


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer