Bad Apple!! rendered in Scratch 3
Add variable monitor output as well
Rework build system


browse  log 



You can also use your local clone with git send-email.


Bad Apple!! in Scratch. Using the blocks as a display.

Abandon all hope, ye who enter here.



In Scratch, blocks are highlighted while they're run. Naturally, the only reasonable thing to do is to use that highlighting as a pixel in a display. In addition, variables can be programmatically hidden and shown, which is basically the same thing as them being pixels.

Each pixel is of the form:

when I receive [$x,$y] {
    show variable [x,y]
    wait until [pixel x,y of the current frame] == 0
    hide variable [x,y]

With each variable [x,y] initially hidden and placed at (x * n, y * n) on the canvas.

The driver is morally equivalent to:

for (int f = 0; f < len(frames); f++) {
    for (int x = 0; x < resolution; x++) {
        for (int y = 0; y < resolution; y++) {
            if ([pixel x,y of the current frame] == 1) {
    while (f < $(seconds since start) * $FPS) {
    wait until f / $FPS seconds have passed since the start


This should work for any video, not just Bad Apple. Stick your desired video in build/badapple.mkv (does not need to be Matroska) before building.


To generate the sb3, you need a POSIX system, ffmpeg, Go, and (unless you provide your own video) curl. make dumps an sb3 at build/project.sb3. make RES=... to change the resolution, 10 is the default. make OFFSET=... to change the offset, 50 is the default. make FPS=... to change the FPS, 10 is the default. After changing the resolution, you'll need to make clean.


It's not great. I suggest using TurboWarp, enabling turbo mode, using the small canvas, zooming out all the way, and shrinking your browser window as much as possible. With all that and the default fps/resolution, I get ~3 dropped frames on my T420 with nothing else running.