Discuss Scratch

SamB721
New to Scratch
3 posts

Touching Color not working

Hi,

I'm currently working on a project for a course and I have a maze in which I want my sprite to be reset to its starting position if it touches a wall. All of the walls are blue, so I set the touching color to that blue, however, when I run my code, it does not return to its home position. Below is the link to the project. Please explain to me where I have gone wrong.

https://scratch.mit.edu/projects/188608799/
mstone326
Scratcher
1000+ posts

Touching Color not working

EDIT: I was wrong..

Your script to detect never runs because the move block runs with forever so it never starts the next touching color. Put that touching color in the move custom block forever and you'll be set.

Last edited by mstone326 (Nov. 24, 2017 20:14:32)


High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
Script_Helper
Scratcher
100+ posts

Touching Color not working

The “Move” block you defined contains a forever block so any blocks below the “Move” block won't run.
axus-
Scratcher
64 posts

Touching Color not working

Basically, remove the forever loop on the move method. Then take the move method and put it inside the main loop.
when green flag clicked
go to x: (-255) y: (-157)
forever
move ::custom
if <touching color (blue)> then
go to x: (-255) y: (-157)
end
end

marigoldkit wrote:

paddle robs banks in his spare time uh.. d-donations yeah
What the heck is DDCC18? https://scratch.mit.edu/discuss/topic/300290/
SamB721
New to Scratch
3 posts

Touching Color not working

Thank You!
SamB721
New to Scratch
3 posts

Touching Color not working

Update: I corrected the code according to the suggestions given however it still does not detect touching the blue color.

Please help

https://scratch.mit.edu/projects/188608799/

Last edited by SamB721 (Nov. 25, 2017 05:06:56)

mstone326
Scratcher
1000+ posts

Touching Color not working

SamB721 wrote:

Update: I corrected the code according to the suggestions given however it still does not detect touching the blue color.

Please help

https://scratch.mit.edu/projects/188608799/

Still the color. I just changed it and it worked. It is just a shade off it appears. I didn't touch any code, just the color swatch and it seems to work fine.

https://scratch.mit.edu/projects/188650257/

High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
hudyg
Scratcher
6 posts

Touching Color not working

my if touching color not working https://scratch.mit.edu/projects/296803776/editor
openPoll
Scratcher
1000+ posts

Touching Color not working

hudyg wrote:

my if touching color not working https://scratch.mit.edu/projects/296803776/editor
Please don't post on old topics; this is called necroposting

Moi? Whaddya wahnt from moi?

——

Inactive Scratcher • making memes wen??? • define defineI have Robux >:)1,000+ hours on Splatoon 2 • 250+ hours on Pokémon White • 100+ hours on MinecraftAn 8 bit remix I love • i have lots game • too lazy to make rainbows • still a proud Windows 7 user
hudyg
Scratcher
6 posts

Touching Color not working

what do you mean
Kraken_Games
Scratcher
100+ posts

Touching Color not working

hudyg wrote:

what do you mean

This topic is old, so you are necroposting. Create your own topic if you have a question.

KRAKEN_GAMES


I live in the depths


.)
johncurry511
Scratcher
6 posts

Touching Color not working

Check to make sure that they are the exact same colors. If this doesn't work message scratch @LiFaytheGoblin
They can help
hudyg
Scratcher
6 posts

Touching Color not working

how do you create your own subject
Milla210508
New to Scratch
1 post

Touching Color not working

gyughiugtb fail
MINECRAFTGAMER2111
Scratcher
100+ posts

Touching Color not working

Try Tapping on the color block. Then the pointer changes. Click on everywhere in the stage.

<touching color [#ba55ca] ?>
battyeford-y3
Scratcher
8 posts

Touching Color not working

there is a way to find the right colour. heres how:
<touching color [#815399] ?>
click the colour icon.
click the button that looks like a pen.
find the wall colour.
BOOSH! IT WORKED!!!


must be pac-man
happyewow
Scratcher
24 posts

Touching Color not working

battyeford-y3 wrote:

there is a way to find the right colour. heres how:
<touching color [#815399] ?>
click the colour icon.
click the button that looks like a pen.
find the wall colour.
BOOSH! IT WORKED!!!


must be pac-man
well i didn't know there was a way like that!

Happyewow makes cool stuff.Games and Animations.He is the best
when green flag clicked
forever
say [follow me] for (2) secs
(Scratch with me)
end
FoofJr
Scratcher
100+ posts

Touching Color not working

battyeford-y3 wrote:

there is a way to find the right colour. heres how:
<touching color [#815399] ?>
click the colour icon.
click the button that looks like a pen.
find the wall colour.
BOOSH! IT WORKED!!!


must be pac-man

happyewow wrote:

battyeford-y3 wrote:

there is a way to find the right colour. heres how:
<touching color [#815399] ?>
click the colour icon.
click the button that looks like a pen.
find the wall colour.
BOOSH! IT WORKED!!!


must be pac-man
well i didn't know there was a way like that!
This is a resolved topic. Please don't necropost. Also, remember to close your scratchblocks

Why hello there! Wonder why you are checking out my signature. While you're at it, why not check out my Gradient generator?
AuddyDloves2code
Scratcher
20 posts

Touching Color not working

It won't work for me either
Basic88
Scratcher
1000+ posts

Touching Color not working

AuddyDloves2code wrote:

It won't work for me either

Please do not necropost

I have moved to @BrowserExtension

Powered by DjangoBB