Discuss Scratch

ebrown39
Scratcher
3 posts

How can I make a sprite follow the mouse but remain unclickable?

I'm currently working on a very simple shooting game, and included in it is a target symbol that I have set up to follow the mouse (via When Flag Clicked -> Forever -> Go to Mouse Pointer). The problem that I'm having is that whenever I try to click on another sprite, the program reads it as clicking the target sprite instead. Does anyone know how I can make the target system visible yet un-clickable, allowing me to click on other sprites while the target sprite is also underneath the mouse?
BY147258369
Scratcher
1000+ posts

How can I make a sprite follow the mouse but remain unclickable?

ifmousedown?theniftouchingsprite following mouse?then Do whatever you want it to do.
ebrown39
Scratcher
3 posts

How can I make a sprite follow the mouse but remain unclickable?

BY147258369 wrote:

ifmousedown?theniftouchingsprite following mouse?then Do whatever you want it to do.

Thanks! I actually figured it out how to do it a different way after I posted:

When I recieve (shot fired)
Forever
If (touching Scratch Cursor) then:
change score by 1
stop this script
else
change misses by 1
stop this script

Last edited by ebrown39 (Oct. 21, 2016 19:34:19)

Austinato
Scratcher
1000+ posts

How can I make a sprite follow the mouse but remain unclickable?

Sorry for not directly answering, but would this fit under the Help with Scripts forum?
ebrown39
Scratcher
3 posts

How can I make a sprite follow the mouse but remain unclickable?

Austinato wrote:

Sorry for not directly answering, but would this fit under the Help with Scripts forum?

Yes, I think it would. Sorry about that, I haven't used the Scratch forum before.
Austinato
Scratcher
1000+ posts

How can I make a sprite follow the mouse but remain unclickable?

ebrown39 wrote:

Austinato wrote:

Sorry for not directly answering, but would this fit under the Help with Scripts forum?

Yes, I think it would. Sorry about that, I haven't used the Scratch forum before.
Oh no, it's fine.
QueenGirly-Girl
Scratcher
1 post

How can I make a sprite follow the mouse but remain unclickable?

I am making this game: https://scratch.mit.edu/projects/445195207/ and I want to let it shoot after I press the green flag.
For the target this is what I added-
whenclickedforevergotomouse pointer
and
whenthisspriteclickedbroadcastShoot!

For the bullet this is what I added-
whenclickedforeverifkeyspacepressed?thenshowswitchcostumeto1gotoTURRETpointtowardsmouse pointerglide0.3secstomouse pointerrepeat9nextcostumehide

I added one more total same block codes in it, but there is no forever block code or if key space pressed. It's When I receive Shoot!

Can you please help me with this?
HTML_JAVASCRIPT_CSS
Scratcher
100+ posts

How can I make a sprite follow the mouse but remain unclickable?

Your Question

QueenGirly-Girl wrote:

I am making this game: https://scratch.mit.edu/projects/445195207/ and I want to let it shoot after I press the green flag.
For the target this is what I added-
whenclickedforevergotomouse pointer
and
whenthisspriteclickedbroadcastShoot!

For the bullet this is what I added-
whenclickedforeverifkeyspacepressed?thenshowswitchcostumeto1gotoTURRETpointtowardsmouse pointerglide0.3secstomouse pointerrepeat9nextcostumehide

I added one more total same block codes in it, but there is no forever block code or if key space pressed. It's When I receive Shoot!

Can you please help me with this?
Hello there, please don't necropost on old topics. Please create a new topic instead.

Now, going on to the scripts,

QueenGirly-Girl wrote:

I added one more total same block codes in it, but there is no forever block code or if key space pressed. It's When I receive Shoot!

Problem:
The key or forever block doesn't work because there's a bug that made the space key hold. Forever! You actually need to reload the page to stop it.

Solution:

Simply use the
whenspacekeypressed
block instead.
bendy6787
Scratcher
2 posts

How can I make a sprite follow the mouse but remain unclickable?

I am working on a cool project, and i want my sprite to stop following my mouse when i click space, how do i do it?
scratchykit5743
Scratcher
1000+ posts

How can I make a sprite follow the mouse but remain unclickable?

bendy6787 wrote:

I am working on a cool project, and i want my sprite to stop following my mouse when i click space, how do i do it?
Don't necropost- this topic is 6 years old-

ugh.

Powered by DjangoBB