Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How Can You Make Pen Detect Colors?
- Riptide901
-
24 posts
How Can You Make Pen Detect Colors?
I've been working on a pen platformer, and I wanted to know something. I was wondering if there was a way to draw a pen sprite (no hitbox, just 100% pen) that can still detect colors. Just using a basic “if touching color _” or “color _ touching color _” block doesn't work. If I set my pen sprite to purple and my ground color to black, then if I use either of those methods the player will fall through the ground. Also, the platformer script I am using is fully functioning with a regularly drawn ground and player, so the problem is the pen. If anybody knows something that could help me or something I haven't thought of, please let me know ASAP. Thank you for your help!
- DD-8861
-
100+ posts
How Can You Make Pen Detect Colors?
I don't think it is possible to use use the Touching Color block without any sprite. You could just put a really tiny dot that is the same color as the character, and use that to detect touching colors, but then your game would only be 99% pen.
How a lot of pen platformers do hit detection is by making the floor out of a bunch of line segments, then putting the coordinates of the endpoints into a list, and then doing a bunch of Math to figure out it the player's coordinates are on any of the line segments.
How a lot of pen platformers do hit detection is by making the floor out of a bunch of line segments, then putting the coordinates of the endpoints into a list, and then doing a bunch of Math to figure out it the player's coordinates are on any of the line segments.
- deck26
-
1000+ posts
How Can You Make Pen Detect Colors?
The touching block is detecting if the sprite costume is touching , the pen has nothing to do with that. Colour touching colour means is the first colour, as part of the sprite's costume, touching the second colour.
So pen touching colour is not possible to the best of my knowledge.
So pen touching colour is not possible to the best of my knowledge.
- Discussion Forums
- » Help with Scripts
-
» How Can You Make Pen Detect Colors?