Set the cursor to a different image depending on a variable

There is. Unfortunately, I don’t know the SugarCube side of things, but you’re not the first author to want to do this… Drag & Drop Puzzle: Check All Droppables Have Accepted a Draggable and Proceed to Next Passage

I believe that topic was inspired by… https://www.digitalocean.com/community/tutorials/js-drag-and-drop-vanilla-js …and by doing it this way, you can customize things like adding a temporary drop shadow, making the target area highlight when over, etc.

However, if those links prove a bit difficult to implement, I suggest using the built in drag-and-drop functionality of HTML/JS. It will fade the image as you move it (default OS feature), but it’s as simple as you can get… https://www.w3schools.com/html/html5_draganddrop.asp

You probably don’t want a piece to be able to be put in a spot where another piece already resides (even if it’s the right location and the other piece is incorrectly placed), and you’ll probably want to determine when the puzzle is assembled properly (and maybe even lock it from being moved around further). We can help with that too once you get the drag and drop part working.

Let us know if you have any other questions. Good luck!

BOLD PREDICTION: Greyelf will chime in with a better solution. :wink:

(see what I did there)

2 Likes