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

#1 2008-10-30 21:42:19

bethzg
Scratcher
Registered: 2008-10-30
Posts: 4

Beginner's questions

Let's say I'm creating a Scratch project. I'm building a script. I run it and then I want the sprites to go back to where they started. How do I get them back to their places so I can continue working on my script without dragging them there? I'm looking for some kind of "reset" feature. Thanks for the help.

Offline

 

#2 2008-10-30 22:02:03

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Beginner's questions

Hi bethzg,

you could tell your sprite to remember where it was before moving it. How about using two variables "startX" and "startY". before moving the sprite it could "set startX to x position" and "set startY to y position" using the variable setter blocks. Once you want the sprite to go back you could just code "goto x: startX y: startY".

Does this make sense to you?


Jens Mönig

Offline

 

#3 2008-10-31 00:05:34

ndonlon
Scratcher
Registered: 2008-10-30
Posts: 1

Re: Beginner's questions

I am trying to create a interactive menu driven program that calls 4 interactive subprograms.  I am having difficulty with my subprograms interfering with the main menu.  Is there another program similar to this out there that I can look at as a reference?  Any help appreciated.

Offline

 

#4 2008-10-31 01:14:32

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Beginner's questions

Hi ndonlon,

"subprograms" - a subset of your project's sprites and backgrounds - can interfere with each other if they are reacting to the same (broadcast) messages or accessing the same set of global variables. So, if you want to create "subprograms" in your "master-project" it's best to make sure each sprite or background belonging to a "theme" (subprogram) has a disctinct set of events it listens to and variables it accesses.

And always remember this:

   1) all scripts topped by the same hat-block will run at the same time, regardless which object (sprite or background) they are in,

   2) broadcasting a message sends this event to every object in the project, not just to the one you're currently editing,

   3) variables can help distinguish which objects are "active" and should react to events (e.g. keystrokes).

Hope that helps!


Jens Mönig

Offline

 

#5 2008-10-31 14:01:50

bethzg
Scratcher
Registered: 2008-10-30
Posts: 4

Re: Beginner's questions

Jens wrote:

Hi bethzg,

you could tell your sprite to remember where it was before moving it. How about using two variables "startX" and "startY". before moving the sprite it could "set startX to x position" and "set startY to y position" using the variable setter blocks. Once you want the sprite to go back you could just code "goto x: startX y: startY".

Does this make sense to you?

thanks for your response. It does make sense.  I am using this with 10 year olds and was looking for a way that might be easier for them. From your response I guess there is no quick and easy button to click on to do this.

Offline

 

Board footer