Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Touching color not working
- flamelord365
-
3 posts
Touching color not working
I was making pac man and I set the color to 15, 98, 100 for the sensing on the dots and 15,98,100 as pac man but the dots are running their script: https://scratch.mit.edu/projects/864329656/
- S-Studios
-
35 posts
Touching color not working
use touching sprite instead, touching colour is laggy and not a good way to do it
- S-Studios
-
35 posts
Touching color not working
also use clones for the pellets instead of separate sprites
- mstone326
-
1000+ posts
Touching color not working
If you are going to do the detection that way you are stuck inbetween values on the color slider, almost like 14.5 instead of 15. If you use the color finder, tap on pac man, and watch carefully the first slider for color will shift just a tiny but but will remain at 15.
That will then work. Try it with ball and ball2
But as mentioned above it would be beneficial to use clones for this project instead of 100 different balls to code.
That will then work. Try it with ball and ball2
But as mentioned above it would be beneficial to use clones for this project instead of 100 different balls to code.
Last edited by mstone326 (June 15, 2023 11:35:13)
- flamelord365
-
3 posts
Touching color not working
how do I make the clones go to the right spot will i have to code that
- mstone326
-
1000+ posts
Touching color not working
Clones would be ideal for this project, you could also drag and drop a touching color script that works into each of your ball sprites. That would save you from using the color finder 100 times.
To use clones, since you already have all the positions laid out the way you want them. Make a backup copy of this project just in case you make a mistake or need to go back.
You can make 2 lists, x_pos and y_pos and you could go around and tap each dot to add those positions to the lists (since you already have them in place).
Then when you create the clones, tell each one to go to the next position in the list. Is this a homework assignment or class project? Just asking, I am a teacher.
To use clones, since you already have all the positions laid out the way you want them. Make a backup copy of this project just in case you make a mistake or need to go back.
You can make 2 lists, x_pos and y_pos and you could go around and tap each dot to add those positions to the lists (since you already have them in place).
when this sprite clicked
add (x position) to [x_pos]
add (y position) to [y_pos]
Then when you create the clones, tell each one to go to the next position in the list. Is this a homework assignment or class project? Just asking, I am a teacher.
- Discussion Forums
- » Help with Scripts
-
» Touching color not working