Move the spider across the wall to a click.
Requirements:
- The spider center should come exactly under the pointer on click (without crossing the wall edge).
- The spider must not cross wall boundaries. When the page is scrolled, nothing should break.
Notes:
- The code should also work with different spider and wall sizes, not be bound to any fixed values.
- Use properties event.clientX/event.clientY for click coordinates.
- You must only modify the file
src/scripts/main.js
Read the guideline before start
Result