How do i make a "touching color" code?

help
colors
sin_and_cos
helpwithcode
#1

@Mathgirl made this project where there's a ball that goes on a wavy line, without objects. the color of the line is black.

8 Likes
#2

I didn't use any "touching colour" code.

It's kind of hard to explain...

5 Likes
#3

tell me!

2 Likes
#4

I'm trying to come up with an explanation, I'll reply when I come up with one.

4 Likes
#5

This isn't the best explanation/tutorial, but I guess it'll have to do. Also, sorry it took so long.


This is the code I used for the wavy line (sorry if you're confused by sin and cos):

To make the ball appear to bounce on this line, I basically used the code in the Set Position block shown above, except replacing the "Value" value with the ball's X position:

Again, I'm sorry if you're confused. I'll try to come up with a better tutorial. (Can anyone help me explain?)

12 Likes
#6

@Mathgirl, would the ball still move along the same track if you were to delete the trail art? If so, then @hopscotch_king, they are independent entities, and each one is separate!

@Mathgirl, AMAZING PROJECT!!! Could I potentially use some of the code in a future project? I would of course give credit! Amazing work, (I think it deserves a feature!)

5 Likes
#7

Yes, it would. :D

Also, thanks! :D I forgot to put it in the project, but all of the code is free to use! :D

Sorry for the late reply, I was asleep.

5 Likes
#8

Thanks so much @Mathgirl!!! You're an amazing coder!!!!!,

2 Likes
#9

ummmm....




@Mathgirl

1 Like
#10

I forgot to mention an important part of the ball's code. Whoops!

You don't need to use the first two blocks, I just used them to make the ball small and grey.

Also, to make the ball respond to tilting, add this rule:

3 Likes
#11

i added the gravity and touching ground code. also the set value to 0 blocks are useless.

#12

I know, but I added them anyway. It's a weird habit I have. :stuck_out_tongue: (Most programming languages need you to set a value to something (like 0, for example) at first.)

1 Like
#13


still exacly like this. same result.

#14

so...

3 Likes
#15

I don't know why that's happening...

1 Like