Afgelopen weken hebben we gewerkt aan het DVD-logo, dit leek heel makkelijk maar was uiteindelijk toch iets lastiger. Maar ons eindresultaat is erg goed gelukt!

Rubrics DVD-logo

Als ik naar de rubrics kijk dan wordt dit een 9!

Link met code!

var dvd
circ3x = 199
circ3y = 225
circ3xSpd = 2
circ3ySpd = 2

function preload() {
  dvd = loadImage('dvd.png')
}

function setup() {
  createCanvas(600, 350);
    pickcolor();
}

function pickcolor() {
  r = random(255);
  g = random(255);
  b = random(255);
}

function draw() {
  background(0);
  tint(r,g,b)
  image(dvd,circ3x,circ3y,150,150)
  
  fill(0)  
      if (circ3x > 451) {
    circ3xSpd = -2
          pickcolor();
  }
    if (circ3x < -1) {
    circ3xSpd = 2
        pickcolor();
  }
  
    if (circ3y > 241) {
    circ3ySpd = -2
        pickcolor();
  }
    if (circ3y < -41) {
    circ3ySpd = 2
        pickcolor();
  }

  circ3x = circ3x + circ3xSpd
  circ3y = circ3y + circ3ySpd
  
  if (circ3x == 451 && circ3y == 241) {
    noLoop()
    winScreen()
  }
}

function winScreen() {
  fill(255,0,0)
  stroke(255, 204, 0)
  strokeWeight(10)
  textSize(100)
  textAlign(CENTER);
text('HOEK!', width/2, height/2)  
}