7.5: Multiple js Files - p5.js Tutorial

preview_player
Показать описание
This video looks at how you can store you code in multiple JS files to keep things organized and modular.

Help us caption & translate this video!

Рекомендации по теме
Комментарии
Автор

Wow, I watched a quarter of these 100-video series almost non-stop. Happy 2023 new year Daniel!

goldthumb
Автор

I know this is like 2 years old. But I've got to say this because of you dude I actually started to understand the logic of programming. I suck hard at it, but atleast I'm not a total moron anymore. THANKS!

RiddlerRiddling
Автор

You are a god. Was about to go and try to learn requireJS and now I realized I don't need to. DUH.

horeaporutiu
Автор

Daniel you're so nice! Seeing you makes me happy! :)

sumanthhegde
Автор

How do we link between js file to another js file?

alfred
Автор

I love this guy and the way he explains stuff! Best teacher. If someone like Daniel would have been a teacher back in my school I would definitely be so much better in Programming.... however – thank you sooo much for sharing this!!

FrauSchwabulski
Автор

Thanks for all your entertaining (and really instructive) videos, they're the best !
I have an other question about handling several .js files though :
Is there a way, with p5, to link/unlink a (or several) specific file(s) dynamically ?

The first idea that comes to mind is to be able to run different sketchs on a single webpage (but i'm sure there are plenty other ways of using it !)

Keep up the good work !

leolimousi
Автор

How about a video explaining a nice way to use ES6 modules in sketches?

Flackon
Автор

how you change the color for p5 editor like function word or this word each word have different color i use windows 8.1 ??

SWAT-qbqy
Автор

when I go to the html file I see something much diferent. Has it changed since the video was made?

jefferybaggins
Автор

hey !
First off thanks a lot for all the help in your tutorials.
As a math student in a prépa in France, i was bored of python, and needed something that is more gratifying as far as visuals and simulating stuff.
Yet though, only way i could reference another p5.js file, was by putting the constructor function ABOVE the sketch.js reference.
Has it changed ?
THX !! Keep up the entertaining videos !

carl
Автор

I wanted to make a slider on my page so I used java script without knowing anything about it (I found an already written code in code pen) and Ive put two js files in my html document because I wanted to add two sliders to the same page for my website and one slider works and the other doesnt. Ive renamed them and added links to the script the way you showed in this video but my second slider is still not responsive (Ive even used two separate and different looking sliders to see if its because of the content)

username_creates
Автор

Hi Daniel. Whats the difference between this method and using import and export please? Thanks

MrRossss
Автор

I've been wondering how the java script files are called in the index.html, cuz whenever I follow the tutorials I get nothing on the browser when I call objects from other js files :(

MistaT
Автор

can multiple files be done using needd help..

shrederbasnet
Автор

Daniel,

I tried to do the same, it still doesnt work. Why would that happen?

dipolar.isorder
Автор

Hi Dan. What can I do if I'd like to add different projects with different canvases to the same index.html file? For instance, this works because you're not creating a canvas with your function. But what if someone has a project folder using VSCode for example and wants to link all of his JS projects to one index.html?

maximos
Автор

Just a FYI, I have a project where I put the mouseClicked() function in its own file and linked to it from index.html. It works fine when not trying to "play" the project from the p5 IDE, but if I open it with the p5 IDE and hit the play button, it doesn't work.

scharfer
Автор

What about Javascript modules in 2020? That doesn't work today.

AZEMBadlen
Автор

7 minutes to show how to link a js file XD

ghostkee