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
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
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
Putting "point in direction 90" "Swtich to costume costume1" and "clear graphic effects" in your initialization may help avoid some of these problems.
Offline