SzabiSch / bootcamp-schedule

0 stars 0 forks source link

Intro to Programming with P5: Multiple Comets #61

Closed codingbootcampseu closed 3 years ago

codingbootcampseu commented 3 years ago

Use the sketch from the previous task.

Hints


let comet1 = { x: 1, y: 2, velocity: 2 };

function draw() {
  renderComet(comet1);
  // update second comet
}

function renderComet(comet) {
  // update comet coordinates
  comet.x = comet.x + comet.velocity;

  // draw comet
  circle(...);

  // calculate if comet is outside of canvas
  ...
}

Example Solution

SzabiSch commented 3 years ago

es funktioniert auch ohne Trashold, besonders ohne die Parameter weiterzugeben. Aufgabe gepseichert