JavaScript tutorial (Part 1)

Your code?

Ok, so I managed to get it to work(I replaced x with y), but now its saying "Whoops! Looks like you've changed something you shouldn't have. Try undoing recent changes or click Start Over." but I can't find the problem with my code;

// position of the ball
var y = 20;
// how far the ball moves every time
var speed = 5;  

draw = function() {
    background(250, 235, 173);
    
    fill(66, 66, 66);
    ellipse(y, 200, 50, 50);

 if(y > 375) {
     speed = -5;
 }
 if(y < 0) {
     speed = 5;
 } 

   
    // move the ball
    y = y + speed;
};

I guess it only works when the variable is named x.

I tried doing x, it says x is undefined....

What's the code that causes the error?

Put var x at the top where var y and var speed are.

1 Like

If I replace all of the y's with x (Same code, just replace the y's with x's) it would say "x is not defined" and I would have to replace all the y's with x's again.

paste your code now
wich lvl r u in

Ok, nevermind I fixed it.

There is a level? well, idk what level I am in but I can tell you how many energy points I have, I have 15,860 energy points.

not useful data

Well, I don't see a level thing....

The thing in url after pt.

I don't see "pt" in url

oh sorry its pc

challenge-number-analyzer, I guess.

Oh, I am actually able to log-in and out of my old and new account, I don't have to be a new user for long, yay!

you have same ip as other account

3 accounts,though

your main account and you and @CRAZY_FUNTIME_FOXY.Wait,where is @CRAZY_FUNTIME_FOXY?

ok