Workarounds for blocks Snap doesn't have (Part 1)

This was originally a topic for blocks from Scratch that Snap doesn't have, but I decided to just allow all workarounds in this list topic.
I didn't make these so if you have one that isn't here, please reply with it so this list can grow.
Each one has a link to where I got the workaround from on the word "Workaround".

  1. Set draggable mode.
    workaround by legoman3.14
    Workaround:
    snap picture

  2. Go forward layers
    workaround by djdolphin
    Workaround:

  3. Layer number block
    workaround by jguille2
    Workaround:
    image
    Reply with any workarounds you know!

  4. "Item # of () in list (or index of () in list)"
    workaround by legoman3.14
    Workaround:
    image

  5. Clone number
    workaround by codeman1044
    Workaround:
    image

  6. varBlocks
    is a project by snapenilk
    the blocks are all work in progress as of 10/19/2019, but I wanted to add them in this list.

  7. "Item Number Of"
    workaround by bh on the topic "Item Number Of"
    Workaround:
    image

  8. "atan2" (possibly incorrectly made, see here)

  1. Some sound blocks

Item # of () in list (or index of () in list)
item%20%23
Clone # (I couldn't decide between sensing and control)
clone%20%23
That's what I have that's useful for now.

varBlocks

Just so you know, this block

can actually be done by just using the set variable command.
snap%20picture
Click the dropdown arrow, then hover over the "my>" symbol to open the sub-menu and select "draggable".

atan2
atan2
credits to Scratch user Jro712

Here's a little demo I made to demonstrate its use:

The whole point of the ATAN2 function is that computing x/y won't work if y=0 (i.e., if you're looking for a point directly above you). So this has to start with an IF to handle that case separately.

Well it seems to work as is, maybe thanks to the less than operator? I honestly don't fully understand why it works since I just replicated the block made by the scratch user lol

Huh. I learn something every day. Atan(infinity) reports 90. Cool.

... So you don't really need the atan2 function at all! It's mainly just getting the angle in the range you want.

I'm not sure I understand. So what would be the other way to point to an xy coordinate that isn't represented by a sprite?

Use a two-item list to represent points (item one is x and item two is y).

point%20towards

Not all of them; just the ones indicated in the project.

You can just use untitled%20script%20pic

I didn't know that the point towards supported list input in snap. Cool.

Yeah we're trying to promote the idea of a point as a semi-primitive semi-abstract data type, so you can have lists of points and so on.

position


9diagonals

(PS Looks even cooler if you keep the pen up while collecting the vertices.)

Ooooh! That's a really neat project, Brian!!

Thanks!

The catch block in the Iteration, composition library does not resume from the throw block when returned to. I have programmed that feature.

It does for me. Can you send an example that fails using the library version? Thanks.

Number of sprites:
untitled script pic (4)