Discuss Scratch

EnriquitoNiggle
New to Scratch
1 post

How do you make a sprite temporarily untouchable?

I'm working on a game where you click a creature and he runs away from you. I want to make a power up where you can't click on him for a couple seconds. How do I do that?
spectre_specs
Scratch Team
1000+ posts

How do you make a sprite temporarily untouchable?

Moved to Help With Scripts

Mod Squad
-TUB-
Scratcher
100+ posts

How do you make a sprite temporarily untouchable?

You can use a variable to keep track of the creature is touchable. When the power up is collected, set the variable to false, and reset it to true after a few seconds. Only run the clicking code if the variable is true.

- T U B -
The United Bathtubs


Select part of my signature and use shift+down arrow to see the rest





CHESHT
Scratcher
27 posts

How do you make a sprite temporarily untouchable?

EnriquitoNiggle wrote:

I'm working on a game where you click a creature and he runs away from you. I want to make a power up where you can't click on him for a couple seconds. How do I do that?
Make a variable, set it to true before you click the creature, make your script so in order to click him, the variable must be true, then when the power up is activated, set the variable to false, so when you click the monster, the script does not happen.

(essentially what the dude above me said)

Last edited by CHESHT (April 8, 2024 03:00:36)

Powered by DjangoBB