Rainbow Hopper explainer


#22

I need help with rainbow hopper


#23

Hi,

Have you looked at the explainer page?

–Frankie


#24

How come the delay doesnt get longer if delay is 17 * 30 and then *60, *90…?


#25

The delay actually does get longer, the reason the animations seem to be evenly spaced is because they all start their delay timers at about the same time. When you run the code, each drawSquare() runs right after the previous one; the whole thing probably takes less than a millisecond.

red:    17*0   =  0ms
orange: 17*30  =  510ms
yellow: 17*60  = 1020ms
green:  17*90  = 1530ms
blue:   17*120 = 2040ms
indigo: 17*150 = 2550ms
violet: 17*180 = 3060ms

The “17” multiplier is used to get the delay close to 0.5 seconds per box. A more precise number would be 16.666…

–Frankie


#26

I Couldn’t get to write or tap the colors and blank space in the a draw square box please I Need Help. I Don’t Know What I Am doing Wrong


#27

Perhaps you deleted the color parameter inside the drawSquare() function declaration?

If you have function drawSquare(__) {, that means when you call the drawSquare() function, it won’t use any input. You want to have function drawSquare(color), so that you can send an input to the drawSquare() function call.

–Frankie