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

#1 2010-10-15 18:31:53

ericlehmann
Scratcher
Registered: 2010-10-15
Posts: 2

Speed on Pong game

hi people,

On Pong, I was wondering if there was a way to control the speed of the ball. If you want to see an example of what I am asking, just open the example pong game in scratch or see mine.

Thank You!   smile 

Eric

Offline

 

#2 2010-10-15 19:50:05

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Speed on Pong game

Yes, all you have to do is make a variable. Make the ball move "x" steps at a time. Set the variable to different levels and it'll go faster and slower.

Offline

 

#3 2010-10-16 04:11:41

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: Speed on Pong game

Yep, all you have to do is go to the variable block section and click "Make a variable"
Name it what ever you want then hit ok.

Then, in the movement script instead of a block that says something like [Move (5) steps] click and drag the new variable block the variable section that has the sides like ( and ) and place it where the 5 or other number was.

You can now change the variable in scripts with the blocks that say [Set [variable] to (_)] and [Change [variable] by (_)] and the ball will move whatever the variable is.

Last edited by colorfusion (2010-10-16 04:12:19)

Offline

 

#4 2010-10-16 10:43:25

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Speed on Pong game

Kayybee and colorfusion are %100 correct. Just make a variable, and drag your variable into the little input box on the movement block. Then use the blocks colorfusion mentioned to change it.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer