Hi @anne
Try declaring x at the top of the program. I would use
var x;
because I’ve not caught up with the ‘let’ fashion. Where you have let x = 100; just have
x = 100;
Think that fixes what you asked, but as well as that, think your imageLoaded definition should not have a parameter “(img)” . Suggest you see the reference for loadImage. The syntax is different from yours.