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

#1 2007-05-28 03:25:16

gilgazit
Scratcher
Registered: 2007-05-28
Posts: 1

Re-Starting a script from step 1

Hello

Rather new in Scratch so please forgive my layman question.

After an animation is created and played, it remains in the last situation. Running the script again, cause the script to continue from where it stopped after the last run.
Usually in software projects, each activation starts from step one and not from where it ended previously.
Is there a way to do so also in Scratch?

Thanks,
Gil.

Offline

 

#2 2007-05-28 04:23:15

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Re-Starting a script from step 1

You put any initialization you need in "when green-flag clicked" scripts.

A lot of end-user programs do initialization for you, but most programming languages do not.  Scratch is attempting to teach programming concepts, more than end-user tool-use concepts, so initialization is required to be explicit.

Last edited by kevin_karplus (2007-05-28 04:24:49)

Offline

 

#3 2007-05-28 15:00:10

mohlar
Scratcher
Registered: 2007-05-24
Posts: 100+

Re: Re-Starting a script from step 1

Like you, I'm new to Scratch. I wanted to experiment with a couple of 'dancing' figures and found that if I followed the green flag with a 'set x' and 'set y' motion block, the dancer always returned to that position for each new run-through. It's easy to alter the values for x and y until you get your character in the right position.

However, if your sprite turns, you may well find that it returns to the right place but is pointing the wrong way for a duplicate run.

Offline

 

#4 2007-05-28 17:00:51

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Re-Starting a script from step 1

Putting "point in direction 90"  "Swtich to costume costume1" and "clear graphic effects" in your initialization may help avoid some of these problems.

Offline

 

Board footer