-
Notifications
You must be signed in to change notification settings - Fork 2
Notes
If you get an error like this,
p5.js says: It looks like there was a problem loading your JSON file... Uncaught TypeError: Failed to fetch
, you are dealing with a cross-origin error. It is likely that you are running the sketch from file rather than through a local server. You can check if this is the case in your current debug session: If the address looks something like file:///home/giorginoserbuciano/p5aiui/index.html
, then you'll need to set up a local server.
Follow these instructions; once you're done, your address should read something like http://localhost:5500/
:
https://github.com/processing/p5.js/wiki/Local-server#vs-code-live-server
This file contains the VS Code launch configuration that accompanies the setup -- it should already be on your computer if you have pulled main
:
A space in the following cases:
- between parameters or arguments
- around operators (=, <, >, etc.)
- before opening a curly bracket {
- around nested calls, like: call( var(x, y) );
Function placement: I suggest re-organizing the code to collect all "helper" functions at the end of the code and ordering them in a consistent manner
Naming: camelCase within the code naming_with_underscores for the file names (--> re-name them?)
This effect is produced by blowing up the x- and y-mouse coordinates up 20 times; drawing is only possible in the upper right corner and is very "coarse".