Mouse lock blocks

Hello! I've made custom blocks with JavaScript that let you lock the mouse cursor and use the mouse's movement deltas instead of its exact position for whatever you want. I think these are quite cool and wanted to share them here :‍)

Here's an example script that you can drag into your project to use the blocks (remember to turn on javascript extensions!):

mouse lock custom blocks script pic

I hope you find these as cool as I do :‍)

that looks cool but i can't use the script pic into snap editor

Project link?


There's no project link directing to the blocks...

You just drag and drop the blocks

I didn't know dragging a picture into the Snap! editor works now...wait shoot does it?

it's worked since snap 8.0..

Yes, but this.

its because of the metadata

you have to drag it into the pallet

OHHHHHHH shoot I didn't know that works.

Amazing blocks! I think it could be very useful for 3D projects like Minecraft recreation.

Yep, I could also use it for a future Beetleblocks Project involving 3D First Person Views. Unfortunately you have to enable Javascript Extensions...

Except one problem, wherever your mouse was (presumably the green flag) is where it stays, and when you click, it clicks that..

People who want to use the Mouse Lock block would then have to make a Start button in the game so that the mouse can't interfere with any other element outside of the activity frame (viewport).

This is very cool. I may be biased because I used mouselock a lot in Turbowarp though.

Clicking does reset the location of the sprite for some reason though, I will investigate this.