Resetting project to start?

3,504 views
Skip to first unread message

Dave Gertler

unread,
Jun 19, 2013, 7:55:19 AM6/19/13
to creative-comp...@googlegroups.com
As a Scratch newbie, I have two related questions:

1. When I'm working on a project, is there a simple way to reset it back to its start? (For example, if I experiment with moving and rotating a sprite, is there a way to put it back where it started, other than issuing commands to return it to the original spot and un-rotate it?)

2. Sometimes, the thumbnail image of a project doesn't show the starting scene, but rather a scene that occurs partway through, even if I click Share when it is at the start. How can I get the thumbnails to always show the start? (Someone asked this before but the thread was deleted.)

Thanks for any help.
-Dave in Delaware

Alan Yorinks

unread,
Jun 19, 2013, 8:16:04 AM6/19/13
to creative-comp...@googlegroups.com
I can't answer #2, because the Scratch page seems to have a mind of its own, but I can try and tackle #1.

Here is a demo program demonstrating returning the sprite to its original position


If you want to have different starting points for the program (pick a level), you would need to create a sprite that would detect the user selection, perhaps send a message to the other sprites to stop, and then send a message to the sprite where you wish to begin or resume.

Dave Gertler

unread,
Jun 19, 2013, 9:30:11 AM6/19/13
to creative-comp...@googlegroups.com
Alan - Thanks for your information.

To reset an individual sprite, I have used a pair of commands like the one you used in your project - a "go to" and a "point in direction". But what I'm looking for is a simple way to reset my entire project to its starting state - all sprites back to where they started, the backdrop changed back to the original one, etc.

Is there really no simple way (single command, menu pulldown option, etc.) to do this? If not, there should be! (I guess reloading the project would work, but that seems like an inefficient and kludge-y way to do it.)

Alan Yorinks

unread,
Jun 19, 2013, 9:48:50 AM6/19/13
to creative-comp...@googlegroups.com
Dave,
    Sorry I misunderstood your question. Without trying to sound flippant, you can click the green flag anytime and the program resets. Since you mention a pulldown option, I am assuming you want the user to provide the trigger. If you mean can you do the reset within your program , yes absolutely. In fact you can have the user go to any portion of the program you wish, but it will take some programming effort on your part. You would need to build the logic into your program to send and receive broadcast messages to do this.

Dave Gertler

unread,
Jun 19, 2013, 11:42:38 AM6/19/13
to creative-comp...@googlegroups.com
Alan - If I click the green flag, that will typically reset the program and start running it (if it has been programmed with "when [green flag] clicked"). I want a way as the programmer - not a user - to reset the program to its initial state, without having it start to run. Sorry if I haven't been clear. I appreciate your help.

-Dave

Alan Yorinks

unread,
Jun 19, 2013, 1:15:51 PM6/19/13
to creative-comp...@googlegroups.com
Dave,
  I think http://scratch.mit.edu/projects/10959499/ does what you are looking to accomplish. Take a look and let me know if this is what you are trying to do.

Alan

Dave Gertler

unread,
Jun 19, 2013, 5:05:11 PM6/19/13
to creative-comp...@googlegroups.com
Alan,

That's a nice piece of programming ... but I'm not looking for a program. I want Scratch to have (and assumed that it did have) a built-in, one-click way of resetting a program to the start. There may be a blindingly obvious one that I'm missing; but if not, I can't imagine why Scratch doesn't offer this feature.

Thanks again,
Dave

Alan Yorinks

unread,
Jun 19, 2013, 7:24:02 PM6/19/13
to creative-comp...@googlegroups.com
Dave,
   I may be wrong (it won't be the first time), but if you are looking for a goto statement, you are not likely to see one in Scratch. That is because almost no object oriented programming language has one (with the exception of C++, and even there it is considered anathema to use it). Java, python and almost any other modern language simply does not support it. One main reason for not having goto is the cleanup problem. Using goto's can lead to what is known as a memory leak - not a good thing.

  If you find out that scratch has what you are looking for, please let me know, but I think your only alternative is to provide the function yourself programatically.

Alan
Reply all
Reply to author
Forward
Message has been deleted
0 new messages