xxxxxxxxxx
38
let state ="intro"
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
if(state== "intro"){
introState();
} else if(state =="game"){gameState();}
}
function introState(){
textSize(20);
text ("Tryk space for at starte", 100, 100);
if(keyIsDown(32)){state = "game";}
}
function gameState(){
text("spillet er igang", 200, 200);
circle(10,10,10) ; }
function gameoverState(){
text("GAMEOVER")
}