-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettingsPage.js
59 lines (45 loc) · 1.54 KB
/
settingsPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
function settingsPage(){
//text for header
noStroke();
fill(0);
textAlign(CENTER);
textSize(35);
textFont(crimsonItalic);
fill(255, 204, 0);
text("Maze Generator", halfWindow, halfWindow * 0.17);
//text for RowsColsSel
textSize(20);
textFont(crimsonRoman);
text("Size of Maze:", halfWindow, halfWindow * 0.30);
//text for frameRateSel
textSize(20);
textFont(crimsonRoman);
text("Frame Rate:", halfWindow, halfWindow * 0.45);
//submit button
rectMode(CORNER);
submitSquare = rect(halfWindow - (85 / 2), halfWindow * 0.65, 85, 35, 10);
fill(51);
textAlign(LEFT, TOP);
submitText = text("Run Maze", halfWindow - (85 / 2), halfWindow * 0.65 + 5);
textAlign(CENTER, BOTTOM);
rowsColsSel.position(halfWindow - 15, halfWindow * 0.35);
frameRateSel.position(halfWindow - 15, halfWindow * 0.5);
frameRateSel.show();
rowsColsSel.show();
noLoop();
}
function mousePressed(){
if(hasTouchscreen == true && gameRunning == true && mouseX >= halfWindow * 1.5 + 3 && mouseX <= halfWindow * 1.5 + 3 && mouseY >= 3 && mouseY <= halfWindow + 3){
gameRunning = false;
} else if(mouseX >= halfWindow - (85 / 2) && mouseX <= halfWindow + (85 / 2) && mouseY >= halfWindow * 0.65 && mouseY <= halfWindow * 0.65 + 35 && gameRunning == false){
//Square submit button x, y, width and height
RunButton();
}
}
function RunButton(){
rebuildMaze();
gameRunning = true;
frameRateSel.hide();
rowsColsSel.hide();
loop();
}