Discuss Scratch

brunodwimba
Scratcher
36 posts

Troubles with the pen tool

When I want to make this script:
when green flag clicked
forever
if <color [#ffff00] is touching [#000000] ?> then
Do stuff :: custom
end
end
If the colours are made with pen, it says the conditional is false, even though the two colours are touching. Can someone help me?
SimpleScratch
Scratcher
500+ posts

Troubles with the pen tool

Just tried it out - drew a line with pen - when I move my cat sprite over the line it seems to work OK for me (I'm not using same colours as you)

https://scratch-mit-edu.ezproxyberklee.flo.org/projects/302426129/

win 10/chrome

Last edited by SimpleScratch (April 13, 2019 12:05:17)

CrazyScoop
Scratcher
100+ posts

Troubles with the pen tool

Edited because my trouble was fixed.

Last edited by CrazyScoop (May 11, 2019 16:41:38)

14152cool
Scratcher
100+ posts

Troubles with the pen tool

CrazyScoop wrote:

My browser / operating system: Windows NT 10.0, Chrome 73.0.3683.103, No Flash version detected

Hello! With the pen extension, I decided to make an “Amount of Ink”. When it draws, it will change it by -0.1, but it sets to -0.1 then changes it by -0.1, is this a bug? Please help me!
make your own topic, please.
brunodwimba
Scratcher
36 posts

Troubles with the pen tool

SimpleScratch wrote:

Just tried it out - drew a line with pen - when I move my cat sprite over the line it seems to work OK for me (I'm not using same colours as you)
My problem is that I want to detect when two colours drawn by pen overlap, not when a sprite overlaps a line.
CrazyScoop
Scratcher
100+ posts

Troubles with the pen tool

14152cool wrote:

CrazyScoop wrote:

My browser / operating system: Windows NT 10.0, Chrome 73.0.3683.103, No Flash version detected

Hello! With the pen extension, I decided to make an “Amount of Ink”. When it draws, it will change it by -0.1, but it sets to -0.1 then changes it by -0.1, is this a bug? Please help me!
make your own topic, please.


Okay!
banana439monkey
Scratcher
1000+ posts

Troubles with the pen tool

CR when moving 25 pixels with one colour, switching and moving 25 more pixels, totalling 50. This “bug” implies the sensing block is for sprites only.

Banana
14152cool
Scratcher
100+ posts

Troubles with the pen tool

the first color has to be on the sprite.
not bug, feature.
banana439monkey
Scratcher
1000+ posts

Troubles with the pen tool

14152cool wrote:

the first color has to be on the sprite.
not bug, feature.
Hmm, that therefore possibly means the block name is misleading. I've never seen anything like that.

Banana
brunodwimba
Scratcher
36 posts

Troubles with the pen tool

My browser / operating system: Windows 7, Chrome 74.0.3729.131, No Flash version detected

When I draw two lines and use this block:
if <color [#FFFFFF] is touching [#FF0000] ?> then
Do stuff ::grey
end
It returns false, I don't know why.
banana439monkey
Scratcher
1000+ posts

Troubles with the pen tool

Dupe

Ironically the same name.

Banana
hedgehog_blue
Scratcher
1000+ posts

Troubles with the pen tool

banana439monkey wrote:

Ironically the same name.
Actually, it looks like they just forgot that they already made a topic about this a month ago and so they made a new one that is the same.
cheddargirl
Scratch Team
1000+ posts

Troubles with the pen tool

hedgehog_blue wrote:

banana439monkey wrote:

Ironically the same name.
Actually, it looks like they just forgot that they already made a topic about this a month ago and so they made a new one that is the same.
Mod thread merging powers activated!
Scratch-Minion
Scratcher
1000+ posts

Troubles with the pen tool

The Scratch Wiki describes the Color()is_Touching() block: https://en.scratch-wiki.info/wiki/Color_()_is_Touching_()%3F_(block)

“The block checks whether a color on its sprite is touching another color”. If it is, the block returns ‘true’.

So the block is defined to check if the first colour which must be part of a sprite is touching a second colour which may or may not be part of any sprite.


The block is not designed to check if two lines drawn in Pen are touching and will not work in this case.

Scratch stores the colour of each pixel on the stage.
If you draw on a pixel on the stage with a new colour using Pen, the colour of that pixel will be updated.
Then only the second colour exists for that pixel.
ie. the colours do not touch as the previous colour has been replaced in the Pen layer.

Scratch would detect if two lines that are differently coloured sprites are touching as they are stored in different layers.
bigmaxerpro123
Scratcher
1 post

Troubles with the pen tool

The Scratch Wiki describes the Color()is_Touching() block: https://en.scratch-wiki.info/wiki/Color_()_is_Touching_()%3F_(block)

“The block checks whether a color on its sprite is touching another color”. If it is, the block returns ‘true’.

So the block is defined to check if the first colour which must be part of a sprite is touching a second colour which may or may not be part of any sprite.


The block is not designed to check if two lines drawn in Pen are touching and will not work in this case.

Scratch stores the colour of each pixel on the stage.
If you draw on a pixel on the stage with a new colour using Pen, the colour of that pixel will be updated.
Then only the second colour exists for that pixel.
ie. the colours do not touch as the previous colour has been replaced in the Pen layer.

Scratch would detect if two lines that are differently coloured sprites are touching as they are stored in different layers.
..Scratch Movie.. ..Scratch Memes.. Scratch Cat Dash ..FPC? Not Me!.. Scratch DictionaryAnimal Hangman

Studios: 3D Tutorials, Polyhedra, 1 Line Challenge, Mandelbrot Art Challenge, Op Art Challenge
egg-cellent123
New Scratcher
36 posts

Troubles with the pen tool

bigmaxerpro123 wrote:

-snip-
Thank you for the detailed post, but please don't post on old topics. The touching color blocks are also known for being clunky and unreliable (from my eggsperience).

Powered by DjangoBB