Keydown movement not working

My student and I cannot seem to figure out why both characters do not move in any directions excpet one. Also, the q and f keys do not create any movement.
Any ideas?

So I think I see a few things here:

  • In lines 185 and 186, there’s a difference between two “if / else” statements vs. " if / else if / else" statements. Check on that for movement. Have the student go line by line and explain to you, or to a coding buddy, or to a rubber duck, EXACTLY what each line of code is saying. Remember that if you have two “if/else” statements back to back, the second one will override the first one if they contradict.
  • I do not see any “keydown = f” or “q” codes, so I don’t know why that would be expected to create movement. Is there a line of code I’m missing?

Ping us back on here if you still are stuck. We’re happy to help!

–Michael K.