Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Reset to "starting position"
- staggroom8
-
1 post
Reset to "starting position"
My students are testing their scripts by pressing on the green flag. The sprite may move or rotate based on the blocks they've chosen. How do they get it back into the “starting position” (ie they rotated the sprite 90 degrees, but want to get it back into the upright position to test again)? I feel like we're all missing something pretty obvious here. Thank you!
- Scratch-Minion
-
1000+ posts
Reset to "starting position"
When a Scratch project is run, its runtime data (position and direction of sprites etc) is updated.
If the project is then run a second time without exiting and reloading the project, the data will start from that updated runtime data.
To force a project to start with certain data every time, we set that data after the Green Flag.
So for each sprite that may move, we must goto its original position after the Green Flag.
For each sprite that may turn, we must set direction to its start direction after the Green Flag. (The default start direction for a sprite is 90).
Same if we resize a sprite etc.
Also any data such as Score, Lives Remaining, etc must be reset to their starting values.
If the project is then run a second time without exiting and reloading the project, the data will start from that updated runtime data.
To force a project to start with certain data every time, we set that data after the Green Flag.
So for each sprite that may move, we must goto its original position after the Green Flag.
For each sprite that may turn, we must set direction to its start direction after the Green Flag. (The default start direction for a sprite is 90).
Same if we resize a sprite etc.
Also any data such as Score, Lives Remaining, etc must be reset to their starting values.
- deck26
-
1000+ posts
Reset to "starting position"
Please don't spam or necropost. You've added nothing useful to this topic and have moved it back to the top of the forum. hi
- Reallife123765
-
2 posts
Reset to "starting position"
Good afternoon , how do you set a starting position for the start of a programme
- deck26
-
1000+ posts
Reset to "starting position"
Best to create your own new topic rather than necropost. Good afternoon , how do you set a starting position for the start of a programme
You can just set things in green flag scripts but even better practice is to do something like this.
when green flag clicked // only one in project
broadcast [initialise v] and wait // sprites/stage respond by setting variables etc
broadcast [ready v] // only run rest of project code now
- Reallife123765
-
2 posts
Reset to "starting position"
Best to create your own new topic rather than necropost. Good afternoon , how do you set a starting position for the start of a programme
You can just set things in green flag scripts but even better practice is to do something like this.when green flag clicked // only one in project
broadcast [initialise v] and wait // sprites/stage respond by setting variables etc
broadcast [ready v] // only run rest of project code now
Thank you
- Discussion Forums
- » Help with Scripts
-
» Reset to "starting position"