Errors when calling a function specified in a different file

Hi! I’m creating a simple game with an unoriginal concept as a learning project.
You can check it out here. (Note: it’s not fully functional yet.)

I’ve run into an issue that’s making it a little tricky for me to debug my code.

I’m using a library called p5.js to help simplify the process of drawing on the canvas.
I uploaded the minified library file and linked to it in my html file (prior to my own js file), and it’s working great.

However, whenever I call or refer to a a function or variable defined by p5, Glitch tells me that the function/variable is not defined.

I know that it IS defined, since my code is working as expected & I’m following the p5 documentation, so I think these error flags are unnecessary. They’re distracting and can obscure actual errors, making my project harder to debug.

Is there anything I can do to convince Glitch that the functions I’m calling are actually defined and exist?

type /* global FUNCTION1-THAT-EXISTS FUNCTION2-THAT-EXISTS etc */ at the top of the file.

2 Likes

thank you, this worked! bit of an annoying workaround - I’m using a lot of p5 functions, lol - but I’ll take it. thanks for your help :slight_smile: