Function Made but Not A Function (?!?)

Hey there,

I’ve got a student that is trying to get their final project finished but is running into error with her functions.

Basically, she’s created a function called levelScore that is called in the draw loop. But the error is saying it’s not a function. There’s another error in line 22 that says levelScore is a function. We’re both very confused as you can imagine.

Thanks for your help!

you are using levelScore as a function and a variable, this is a naming conflict that you must resolve it by switching the variable or the function within the namespace

function draw() {
increaseLevelScore();

  // draw background
  // update sprites

  drawSprites();
}

// Create your functions here
function increaseLevelScore() {
  textAlign(CENTER, TOP);
  if (keyWentDown("space")) {
    levelScore = levelScore + 1;
  }
}

here is an example of how you would fix it

i would also recommend that you also comment out setWater as it is also currently not a function within your program

Varrience