SzabiSch / bootcamp-schedule

0 stars 0 forks source link

P5 Kata: Infinite Falling Ball #68

Closed codingbootcampseu closed 3 years ago

codingbootcampseu commented 3 years ago

infinite-falling-ball

Hints

Use a global variable speed to define the speed of the ball.

let speed = 1;

function draw() {
  // other stuff

  // if ball reaches the end
  // reset the ball position
  // increase speed
  speed = speed + 1;
}

Bonus

Use the increment operator ++ to increase the speed.

let speed = 1;

// The ++ operator adds 1 to a number variable
// speed = speed + 1;
speed++;

Use the mousePressed() function to reset the speed of the ball when it gets to fast.

function mousePressed() {
  speed = 1;
}
SzabiSch commented 3 years ago

nach dem bouncing ball, war die Aufgabe ziemlich easy :)