Help, don't know how to fix error

I am getting an error- incompatible operand types char and string- and I don’t quote know how to fix it. I’m pretty new to this so any help would be greatly appreciated.

Here’s what I’ve got

int top=350;
boolean lefttop=true;
void setup(){
  size(800,800);
}

void draw(){
  background(0);
  fill(0,255,0);
  rect(top,0,100,25);
  if(lefttop){
    if(keyPressed){
      if(key==“a”||key==“A”){
        top=top-10;
      }
    }
  }
}

https://processing.org/reference/String.html

Which states:

Strings are always defined inside double quotes ( “Abc” ), and characters are always defined inside single quotes ( ‘A’ ).

:slight_smile:

2 Likes