ScratchData LogoScratchData
Back to _nix's profile

Square Art ! Remix

_N_nix•Created November 10, 2017
Square Art ! Remix
0
0
11 views
View on Scratch

Instructions

Just click the green flag and watch. See inside and change the number beside "cycle with size increment" if you want - a higher number means it'll be more blocky, a lower number bumpier but slower.

Description

Thanks to @thehappytroll for the original "square art" remix. Thanks to @MrRubiksSC for creating the original "circle art" project, and all the scripts in it. I simplified a *lot* of code! Some interesting things: - As a spin-off of the "Square Art!" project, I made the squares always draw as squares, not diamonds (so, pointing along 90 degrees, instead of in a random direction). - I used a custom block with "run without screen refresh" checked for the main loop inside the "forever" block. That makes the whole thing run a lot quicker, and makes it so you don't need turbo mode on for it to go at a sane speed. (Take a look at the "cycle" custom block.) - I used custom blocks where I'd normally write code twice ("grow until touching color"), and where it made sense to split the scripts into separate, more contained chunks ("try to change size"). - I changed "go to x: (random -360 <-> 360) y: (random -180 <-> 180)" to "go to random position". I was GOING to say that this is a handy feature added pretty recently, but it turns out it was added in February 2016. Am I old?? - I got rid of the "Color" variable, which wasn't necessary. I saw that the costume was being changed *after* the loop to grow the sprite ("repeat until touching color"). That was probably so that the sprite wouldn't detect itself, but that's not actually a problem (Scratch is smart enough to know that; it only checks pixels below the sprite.. I think :) ), so I moved the set costume block above the loop. - I made the square change size until it actually hits either black or white, not when it hits an edge. I think this makes a nicer pattern. I still needed a fail-safe for when the sprite can't grow anymore because it hit the edge, so I made a "try to change size" custom block. It makes note of the sprite's old size, then uses the "change size" block. If the new size is the same as the old size, then the sprite didn't grow at all, and we mark the "change size failed?" variable as "failed". (If the sprite *did* grow, we set that variable to "succeeded".) Since the sprite failed to grow, we can assume it will also fail to grow next time we use the same "change size" block, so we stop the grow loop. Too bad the person who originally made this project probably won't see it - they won't get a notification for this, because it's a remix of @thehappytroll's project, and it also looks like they've been offline for a few months. But instead, somebody active, like @thehappytroll, probably will see it :)

Project Details

Project ID185569307
CreatedNovember 10, 2017
Last ModifiedNovember 10, 2017
SharedNovember 10, 2017
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root