stage3 - после этапа 2. Я хочу знать, как определить, активны ли mouseIsPressed
и stage2.
Я уже попробовал if(mouseIsPressed&&stage2===true){so on}
var hp=100;
var name=["boromon","telemon","heptamon","coromon"];
var boromon={
eyecolor:"blue",
skincolor:[0,0,255],
abilitys:["beam of life","blinding bite","stare strike"]
};
var enemy=[hp,name[1]];
fill(255, 0, 0);
text(name[0]+" wants to be your freind"+" click to accept",10,10);
var currentCharacter=[];
fill(41, 23, 23);
text(currentCharacter,10,10);
var stage2=function(){
background(255, 0, 0);
text(currentCharacter+" is now your freind click to continue",10,10);
};
var stage3=function(){
background(0, 174, 255);
var star=getImage("space/star");
image(star,10,10);
image(star,10,10);
image(star,10,10);
image(star,10,10);
};
draw=function() {
if(mouseIsPressed)
{currentCharacter=name[0];}
if (mouseIsPressed){
stage2();
if(mouseIsPressed){stage3();}
}
};
Iхочу нажать кнопку мыши и вывод будет разным каждый раз