I was wondering if it is possible to important a p5js file into another file. I am creating a non linear adventure game. If the player presses on a certain button, I want that button to activate a mini game that I have in another p5js file.
function mouseReleased() {
cursor(ARROW);
if (scene0 == true) {
if ((mouseY > 162) && (mouseY < 248) && (mouseX > 54) && (mouseX < 278)){
scene0 = false;
scene1= true;
}
}
if (scene1 == true) {
if ((mouseY > 408) && (mouseY < 482) && (mouseX > 52) && (mouseX < 222)){
scene1 = false;
miniGame1 = true;
}
}
Thank you.