I am making a small game using p5.js and I wanted to link to another html file in that folder.
I tried link("level2.html"); but it didn't work
I also looked at all the references in the p5.js website but i couldn't find any.
Where are you trying to access the HTML file from? In index.HTML? Or in the .js sketch?
Make sure you have the HTML file in same folder as the index.HTML file.
Remember that p5.js edits JavaScript code and in order to display your sketch in a browser you need the index.HTML file. In the index.HTML file you can edit HTML code and link to other HTML files, is that's what you want.
Answers
*HELP
Where are you trying to access the HTML file from? In index.HTML? Or in the .js sketch?
Make sure you have the HTML file in same folder as the index.HTML file.
Remember that p5.js edits JavaScript code and in order to display your sketch in a browser you need the index.HTML file. In the index.HTML file you can edit HTML code and link to other HTML files, is that's what you want.
my html file is the same folder
is there any function to linking like for processing.js I used to type
link("level2.html");
but idk how to link in p5.js
In short i am making a game like this
www.214839.github.io/Escape-Room-Experience
and i want to link two levels
for example. i finished one task or pressed one button I want to go to another html file
if you get what I mean
*http://214839.github.io/Escape-Room-Experience
This game was made through processing.js
I want to create a similar game using p5.js
https://GitHub.com/processing/p5.js/pull/532
Hmm, what does your index.html look like?
Maybe this helps: https://forum.processing.org/two/discussion/8809/link-function#latest