ScratchData LogoScratchData
Back to _nix's profile

Layer execution order

_N_nix•Created December 31, 2019
Layer execution order
4
0
93 views
View on Scratch

Instructions

Click a sprite to bring it to the front! Here's the scripts, at a glance: Stage: when flag clicked: var = 1 Scratch Cat: when flag clicked: var = var + 2 when space pressed: var = var + 2 (when sprite clicked: go to front) Gobo: when flag clicked: var = var * 2 when space pressed: var = var * 2 (when sprite clicked: go to front) You can use the results, which change depending whether Scratch Cat or Gobo is visually in front, to help understand the execution order. Check out the notes below for all the details!

Description

The stage reacts only to the green flag; the sprites react to both the green flag and the space bar (in the same way). The stage appears to always run last, as the final value upon pressing the green flag (irregardless of which sprite you've brought to front) is 1. scratch (+2) -> gobo (*2) -> stage (set 1): 1 gobo (*2) -> scratch (+2) -> stage (set 1): 1 (it could be either of these - you get the same result!) If you press the green flag (to reset the value to 1) and then press space while the Scratch cat is brought to the front, the Scratch cat runs first. stage (set 1) -> scratch (+2) -> gobo (*2): 6 If instead you bring Gobo to the front (and press the GF to reset the value), the final value is different, indicating Gobo running first this time. stage (set 1) -> gobo (*2) -> scratch (+2): 4 (The stage does not react to having a "go to (front/back) layer" dragged into it and activated; it still runs last even if you run "go to front layer".)

Project Details

Project ID356670511
CreatedDecember 31, 2019
Last ModifiedSeptember 27, 2022
SharedDecember 31, 2019
Visibilityvisible
CommentsAllowed