Hi, i’m newbie to p5.js, and I just want to reproduce this simple code : https://www.youtube.com/watch?v=17WoOqgXsRM
I’ve set up my p5 environment on Atom editor with local server to see my results on browser.
So I have my main class sketch.js and an outer class Star and I want to instantiate Star object in my main class but I got unexpected identifier error for ‘Star’ in my console. I thought by adding
<script src="Star.js"></script> in index.html would solve the problem but it didn’t.
I need to import this class but I don’t how. Thanks for the help in advance !
Sorry, it’s a mistake I think, the class has been correctly imported. The error is something else but I can’t understand what. Here’s a picture of my console :
Welcome to the forum!
It would be great if you can share entire the code although I can see a portion in your screenshot.
Also if you want the answer, in fact the Coding Train already made a p5.js version of the starfield, which you can find on their website:
Thank you, yes for a first post it is not clear at all, I will do better next time by adding all the code and complete description.
Thanks a lot !
no problem! I think the newer episodes of the coding challenges are in p5.js, but most of them have p5.js versions even if they were originally coded in processing (java)