⚡ G-Warp

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

  1. Select a sprite. From Events, build a script that starts with when flag clicked and sends broadcast [spark].
  2. Make a second script with when I receive [spark], then add a Looks action such as say [Message received!].
  3. 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

  1. Open More → Settings and find Power lines if it is available in your current build.
  2. Enable the overlay, return to Code, and press Start.
  3. Watch for a visual connection from broadcast [spark] to the matching receiver script. The receiving hat should activate when the message is sent.
  4. Turn Power lines off if the overlay makes a large workspace harder to read.

Step 3 — Compare a custom block

  1. Create a My Block (custom block), give it a simple name such as flash, and put a Looks action under its definition.
  2. Call the custom block from another script while the project runs.
  3. 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.

Glossary → · Parents & teachers → · All tutorials