Search code examples
mit-scratch

How to change a variable when touching a pen drawing?


I'm making a game in Scratch where if they touch something their HP goes down. I'm planning on making multiple of the sprite appear without having to use clones or make several of the same sprite so I'm using the pen extension to draw it. I'm running into a problem though. When I tell it to change the variable by touching the sprite, the pen copy doesn't count as it so it won't change it. How do you make the variable change when touching the pen?

The main reason I don't plan on using clones is due to Scratch's 300 clone limit. I intend on having more than 300 of the thing i'm making, which would go over Scratch's clone limit and why most people use the pen to get around that. The answer marked as accepted technically solves the problem until that point so I marked it as correct.


Solution

  • For the sake of providing a formal answer to this question, I'll just rehash the comments above.

    A solution that worked ended up being to create an invisible (via the ghost effect) clone that goes over each pen drawing - each clone acting like a hitbox.