Tutorial 5: Read scripts like a circuit with Power lines
You will make: a project where a broadcast triggers another script, then use the Power lines visual overlay to follow the connection while it runs.
Step 1 — Make two scripts
- Select a sprite. From Events, build a script that starts with
when flag clickedand sendsbroadcast [spark]. - Make a second script with
when I receive [spark], then add a Looks action such assay [Message received!]. - Use exactly the same broadcast name in both scripts. The spelling and dropdown choice must match.
when flag clicked broadcast [spark] when I receive [spark] say [Message received!]
Step 2 — Switch Power lines on
- Open More → Settings and find Power lines if it is available in your current build.
- Enable the overlay, return to Code, and press Start.
- Watch for a visual connection from
broadcast [spark]to the matching receiver script. The receiving hat should activate when the message is sent. - Turn Power lines off if the overlay makes a large workspace harder to read.
Step 3 — Compare a custom block
- Create a My Block (custom block), give it a simple name such as
flash, and put a Looks action under its definition. - Call the custom block from another script while the project runs.
- If Power lines shows the definition-to-call connection in your version, use it to follow where the call goes.
Gotcha: Power lines are a debugging overlay, not part of the project artwork or code. If you see no connection, confirm the feature is enabled, the correct scripts are running, and the broadcast/custom-block names match. The current-build visuals have not been independently tested in this session.