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

#1 2013-04-19 16:03:36

maryam08
New Scratcher
Registered: 2013-04-19
Posts: 7

How to create a script for a Ball moving down vertically?

How do I create a script for getting the ball moving vertically down the stage.

English description for the script:

1. Clear the stage

2. Place the ball sprite at the position (0, 170)

3. Make Ball appear on the stage

4. So long as the y_position of ball is greater than or equal to -175, it should move down the Stage in 1 -step intervals. NOTE that Ball should stop moving when it reaches y_position = -175

5. When the Ball reaches its destination, stamp a copy of Ball's costume on to the Stage.

6. Make Ball disappear from the Stage.

Please someone help me with a Script for this description.

Offline

 

#2 2013-04-19 16:18:45

Tohmis
Scratcher
Registered: 2013-02-18
Posts: 58

Re: How to create a script for a Ball moving down vertically?

This should work  smile

when gf clicked
clear
Go to x:(0) y:(170)
show
Repeat until <[y position] < [-175]>
Change y by (-1)
end
stamp
hide


Last edited by Tohmis (2013-04-19 16:19:18)


Check out my new game
http://scratch.mit.edu/static/projects/Tohmis/3300878_sm.png

Offline

 

#3 2013-04-19 16:27:19

maryam08
New Scratcher
Registered: 2013-04-19
Posts: 7

Re: How to create a script for a Ball moving down vertically?

Thank you very much Tohmis. You are a life saver. Thank you again.

Offline

 

#4 2013-04-19 16:32:43

Tohmis
Scratcher
Registered: 2013-02-18
Posts: 58

Re: How to create a script for a Ball moving down vertically?

Your welcome  smile


Check out my new game
http://scratch.mit.edu/static/projects/Tohmis/3300878_sm.png

Offline

 

#5 2013-04-19 16:38:09

maryam08
New Scratcher
Registered: 2013-04-19
Posts: 7

Re: How to create a script for a Ball moving down vertically?

Hi Tohmis thank you for your help but it your script has not worked. Can you double check it please.

Offline

 

#6 2013-04-19 16:39:38

Tohmis
Scratcher
Registered: 2013-02-18
Posts: 58

Re: How to create a script for a Ball moving down vertically?

What happened? (I'm online with my iPod)

Last edited by Tohmis (2013-04-19 16:45:31)


Check out my new game
http://scratch.mit.edu/static/projects/Tohmis/3300878_sm.png

Offline

 

#7 2013-04-19 16:45:18

maryam08
New Scratcher
Registered: 2013-04-19
Posts: 7

Re: How to create a script for a Ball moving down vertically?

Its not working. The ball is suppose to move. It does not move at all.

Offline

 

#8 2013-04-19 16:47:10

PresidentialNyan
Scratcher
Registered: 2013-02-23
Posts: 59

Re: How to create a script for a Ball moving down vertically?

Tohmis wrote:

This should work  smile

when gf clicked
clear
go to x: [0] y: [0]
show
repeat until <(y position) < [-175]>
 change y by [-1]
end
stamp
hide


there. that should work.  smile

Last edited by PresidentialNyan (2013-04-19 16:49:01)


http://i43.tinypic.com/4ruira.jpg

Offline

 

#9 2013-04-19 16:52:37

Tohmis
Scratcher
Registered: 2013-02-18
Posts: 58

Re: How to create a script for a Ball moving down vertically?

This realy should work  smile

when gf clicked
clear
Go to x:(0) y:(170)
show
Repeat until <(y position) < [-175]>
Change y by (-1)
end
stamp
hide

Last edited by Tohmis (2013-04-19 17:18:32)


Check out my new game
http://scratch.mit.edu/static/projects/Tohmis/3300878_sm.png

Offline

 

#10 2013-04-19 17:10:24

maryam08
New Scratcher
Registered: 2013-04-19
Posts: 7

Re: How to create a script for a Ball moving down vertically?

thank you I will try this now.

Offline

 

#11 2013-04-19 17:21:57

maryam08
New Scratcher
Registered: 2013-04-19
Posts: 7

Re: How to create a script for a Ball moving down vertically?

Hi it still does not work. When I click the ball should move down the stage 1 step interval or one step at a time.

Offline

 

#12 2013-04-19 17:25:04

Tohmis
Scratcher
Registered: 2013-02-18
Posts: 58

Re: How to create a script for a Ball moving down vertically?

Have you wrote the negatives?


Check out my new game
http://scratch.mit.edu/static/projects/Tohmis/3300878_sm.png

Offline

 

#13 2013-04-19 17:42:29

maryam08
New Scratcher
Registered: 2013-04-19
Posts: 7

Re: How to create a script for a Ball moving down vertically?

yes

Offline

 

#14 2013-04-19 17:43:56

Tohmis
Scratcher
Registered: 2013-02-18
Posts: 58

Re: How to create a script for a Ball moving down vertically?

Have you wrote the

 < (y position) < [-175] > 
correct?

Last edited by Tohmis (2013-04-19 17:51:59)


Check out my new game
http://scratch.mit.edu/static/projects/Tohmis/3300878_sm.png

Offline

 

#15 2013-04-21 15:23:33

le_me26
New Scratcher
Registered: 2013-04-21
Posts: 5

Re: How to create a script for a Ball moving down vertically?

Hi i have kind of simillar project and for me the script made by Tohmis worked fine except the part that the ball does not dissapear, I can still see it prtly on stage i used different kind of options...maybe anyone would suggest what block i should use to make the ball disapperar completley? Thanks upfront  smile

Offline

 

Board footer