Scratchblocks Test
This is a test page for scratchblocks integration.
Basic Example
セクション「Basic Example」Code:
セクション「Code:」when flag clickedmove (10) stepsExample with Variables
セクション「Example with Variables」Code:
セクション「Code:」when flag clickedset [counter v] to (0)forever change [counter v] by (1) say (counter) wait (1) secondsendExample with Conditionals
セクション「Example with Conditionals」Code:
セクション「Code:」when flag clickedforever if <key [space v] pressed?> then play sound [pop v] wait (0.5) seconds endendExample with Multiple Blocks
セクション「Example with Multiple Blocks」Code:
セクション「Code:」when flag clickedclearforever pen down if <touching [mouse-pointer v]?> then switch costume to [button v] else add (x position) to [list v] end move (10) steps turn ccw (9) degreesendHow it works
セクション「How it works」The ScratchblocksRenderer component from scratchblocks-astro dynamically loads scratchblocks on the client and uses its parse/render APIs to turn the provided code prop into Scratch-style block visuals.
This renderer was extracted and published as a standalone package: scratchblocks-astro.