Discuss Scratch

The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

Edit: Areas now are oriented counterclockwise.
This block would allow you to click an area of a sprite. It looks like this.

when area [ v] of sprite clicked  :: events :: hat
This way, you can click an area of a sprite for a different function. Not sure what I mean? Let's take a look at our friend the Scratch Cat.



For a better explanation, starting from the closest area to 12:00 as Area 1, it goes counterclockwise.

If this was a boss clicker game, clicking on his tail might do some damage, but his head would do more.

If this was a take-apart-and-put-back-together game, you would have to have the areas in the right place. Ignore this

I'ma get screamed at for this last one

If it was a salvage game, you would have to remove the right piece to avoid a jumpscare.

You see what I'm getting at? Neat block. But, I'ma predict the future: No support.

If this is a duplicate I will punch my computer

Last edited by The-Molten-Freddy (June 14, 2022 20:28:17)

The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

Oh shoot this needs to be in suggestions
IndexErrorException
Scratcher
500+ posts

When area ___ of sprite clicked

How would one define areas of a sprite? How would one know which area to target? There should also be current touching area reporter. Very specific but difficult to workaround, support.
The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

XxhackerlolxX wrote:

How would one define areas of a sprite? How would one know which area to target? There should also be current touching area reporter. Very specific but difficult to workaround, support.
Do you see my picture? That's how it's defined. As for the detect, good idea.

Last edited by The-Molten-Freddy (June 14, 2022 19:39:18)

musicROCKS013
Scratcher
1000+ posts

When area ___ of sprite clicked

Is this an acceptable workaround?

You can just use clones.

//first let’s make a setup for this workaround
set [Clone# v] to [0]//for this sprite only
repeat (6)
change [Clone# v] by (1)
end

when I start as a clone
switch costume to (join [Part ] (Clone#))
add [false] to [touching? v]
add [false] to [clicked? v]
repeat until <>//replaceable with a forever block
replace item (Clone#) of [touching? v] with <touching [mouse pointer v] ?>
replace item (Clone#) of [clicked? v] with <<touching [mouse pointer v] ?> and <mouse down?>>
end

//now that we’re done with the setup, we can work on the workaround for the actual block

when green flag clicked
forever
if <(item ( v) of [list v] :: list) = [true]> then
...::grey
end
end
The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

musicROCKS013 wrote:

Is this an acceptable workaround?
Big snip
No. I want it for the original sprite.
musicROCKS013
Scratcher
1000+ posts

When area ___ of sprite clicked

The-Molten-Freddy wrote:

musicROCKS013 wrote:

Is this an acceptable workaround?
Big snip
No. I want it for the original sprite.
What do you mean “original sprite”? Please elaborate.
The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

Plus, you can't divide clones, not like this
The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

musicROCKS013 wrote:

The-Molten-Freddy wrote:

musicROCKS013 wrote:

Is this an acceptable workaround?
Big snip
No. I want it for the original sprite.
What do you mean “original sprite”? Please elaborate.
The sprite you're clicking. duh
musicROCKS013
Scratcher
1000+ posts

When area ___ of sprite clicked

The-Molten-Freddy wrote:

Plus, you can't divide clones, not like this
Divide clones..? When I added the
switch costume to (join [Part ] (Clone#))
block, I was suggesting that you have to make a bunch of different costumes for this workaround.
The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

musicROCKS013 wrote:

The-Molten-Freddy wrote:

Plus, you can't divide clones, not like this
Divide clones..? When I added the
switch costume to (join [Part ] (Clone#))
block, I was suggesting that you have to make a bunch of different costumes for this workaround.
Oh, hell no. This is waaaaaaaaaaaaaaaaay simpler.
musicROCKS013
Scratcher
1000+ posts

When area ___ of sprite clicked

The-Molten-Freddy wrote:

The sprite you're clicking. duh
The workaround I made uses clones. There isn’t a difference (technically).

Okay what did you mean by “it” then?

The-Molten-Freddy wrote:

No. I want it for the original sprite.
If you’re talking about the code, this would only require one sprite.
The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

musicROCKS013 wrote:

The-Molten-Freddy wrote:

The sprite you're clicking. duh
The workaround I made uses clones. There isn’t a difference (technically).

Okay what did you mean by “it” then?

The-Molten-Freddy wrote:

No. I want it for the original sprite.
If you’re talking about the code, this would only require one sprite.
I want 1 block for 1 sprite. Your “workaround” is actually a pain in the butt code. I'm simplifying that.
musicROCKS013
Scratcher
1000+ posts

When area ___ of sprite clicked

The-Molten-Freddy wrote:

This is waaaaaaaaaaaaaaaaay simpler.
Is it though? The only thing you’ve really said about connecting parts of the costume is by (?) putting text boxes with a number by them.
The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

musicROCKS013 wrote:

The-Molten-Freddy wrote:

This is waaaaaaaaaaaaaaaaay simpler.
Is it though? The only thing you’ve really said about connecting parts of the costume is by (?) putting text boxes with a number by them.
That's a representation. The sprite would be together with no labels, but each are is how it's labeled.
musicROCKS013
Scratcher
1000+ posts

When area ___ of sprite clicked

The-Molten-Freddy wrote:

I want 1 block for 1 sprite. Your “workaround” is actually a pain in the butt code. I'm simplifying that.
Most of the code is the setup, or the code that generates the clones and makes them update their status (clicked/not clicked) on the list. You only need to use that last bit of code at the end to detect this.
The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

musicROCKS013 wrote:

The-Molten-Freddy wrote:

I want 1 block for 1 sprite. Your “workaround” is actually a pain in the butt code. I'm simplifying that.
Most of the code is the setup, or the code that generates the clones and makes them update their status (clicked/not clicked) on the list. You only need to use that last bit of code at the end to detect this.
Grr I want a hat block to do that.
musicROCKS013
Scratcher
1000+ posts

When area ___ of sprite clicked

The-Molten-Freddy wrote:

That's a representation. The sprite would be together with no labels, but each are is how it's labeled.

Okay, but how do you label them?

Last edited by musicROCKS013 (June 14, 2022 19:55:07)

The-Molten-Freddy
Scratcher
500+ posts

When area ___ of sprite clicked

musicROCKS013 wrote:

Okay, but how do you label them?
Most sprites are breakable. Those pieces are the areas. Non breakable sprites only have 1 area.

Last edited by The-Molten-Freddy (June 14, 2022 19:57:37)

musicROCKS013
Scratcher
1000+ posts

When area ___ of sprite clicked

musicROCKS013 wrote:

The-Molten-Freddy wrote:

Okay, but how do you label them?
Most sprites are breakable. Those pieces are the areas. Non breakable sprites only have 1 area.
But how do you know which part has what Area number? Don’t you dare tell me to refer to your mock-up, because that doesn’t explain how you got those numbers for the mock-up.

Last edited by musicROCKS013 (June 14, 2022 19:58:05)

Powered by DjangoBB