Discuss Scratch

wrestling9
Scratcher
56 posts

pen glitch

So i was making a game that uses a pen to draw a sprite on a x and y variable, and then checks if an arrow key is pressed, then it changes the variable by 7 in that direction. to make the guy not go through walls i made it also check if the pen color for the body of the guy is touching black, to go in the apposite direction. but it would not sense if the color from the pen was touching black! at first i thought i coded it wrong, but after testing in a forever loop to check if it was touching black, but it the output came out false, when i knew it was touching black! It sounds complicated, but in short, if you use the
<color [#f0f] is touching [#0f0]?>
block it won't sense if a pen color is touching a other color. I hope someone can help!
drmcw
Scratcher
1000+ posts

pen glitch

You can't sense if a pen colour is touching a colour. You can only sense if a colour on the sprite is touching another colour, but the “another colour” can be a drawn pen colour or stage colour or other sprite.or clone colour.

So in your block above the pink colour has to be a colour on the sprite or clone. The green colour can be a colour from anywhere.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
wrestling9
Scratcher
56 posts

pen glitch

Ok thanks that helped me a lot.
Demon4511
Scratcher
51 posts

pen glitch

that sucks

Powered by DjangoBB