Here’s what I’m trying to do.
Sometimes when you refresh it works just fine.
Sometimes I get this error:
If you can’t see its says:
Uncaught TypeError: Cannot read property ‘width’ of undefined
at e.image (p5.min.js:9)
at draw (sketch.js:87)
at e.redraw (p5.min.js:8)
at e. (p5.min.js:7)
There’s a link to the Github page with all the code in it in the website. All of the code is in the sketch.js file.
Is there something I’m doing wrong? Or is this a p5.js bug? I also wish to know what’s wrong in this situation.