Dude I really need help! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Dude I really need help!

This code is doing wierd things to all my devices. No matter where I try to run it, none of my devices can do it and either the browser says error cannot load or my sololearn app has to restart!! Please help!! I'm using the JavaScript framework p5.js. https://code.sololearn.com/Wh6wEEbexGpM/?ref=app

6th Jul 2018, 5:31 AM
Shedrick Williams
Shedrick Williams - avatar
11 Answers
+ 3
for(i = 0; i < particles.length; i++){ particles.push(p); } This would make particles keep increase infinitely
6th Jul 2018, 5:44 AM
Calviղ
Calviղ - avatar
+ 2
Where is your function execution?
6th Jul 2018, 5:34 AM
Calviղ
Calviղ - avatar
+ 2
https://code.sololearn.com/W7374Rvqe5zP/?ref=app Tried to modify some... I dont know p5, but I guess this the code, in order to be functional workable.
6th Jul 2018, 7:03 AM
Calviղ
Calviղ - avatar
+ 1
Then p5.js should be run before your script. Put all your script before end of closing body tag
6th Jul 2018, 5:41 AM
Calviղ
Calviղ - avatar
+ 1
Yes that is the point for the particles to keep being made and yes I will fix the performance issues
6th Jul 2018, 5:46 AM
Shedrick Williams
Shedrick Williams - avatar
+ 1
Don't put your p5 codes on javascript tag, cause it would run before p5 library loaded
6th Jul 2018, 6:25 AM
Calviղ
Calviղ - avatar
+ 1
Actually this is pretty much exactly how i wanted it Thank You !!
6th Jul 2018, 1:18 PM
Shedrick Williams
Shedrick Williams - avatar
0
In p5.js Setup and Draw do not need to be executed ad they are functions the library run themselves https://youtu.be/8j0UDiN7my4 this is Daniel Shiffman Teaching about this if you are interested.
6th Jul 2018, 5:37 AM
Shedrick Williams
Shedrick Williams - avatar
0
I do not believe I have an error really but maybe the infinite loop I have is too much? All my devices could run this same program before it's just that NOW it like breaks a bunch of stuff
6th Jul 2018, 5:41 AM
Shedrick Williams
Shedrick Williams - avatar
0
p5.js is the only thing I link in my html. It's the only thing I added to my html, and it is already inside the body tags.
6th Jul 2018, 5:43 AM
Shedrick Williams
Shedrick Williams - avatar
0
What tag should I run them with?
6th Jul 2018, 6:33 AM
Shedrick Williams
Shedrick Williams - avatar