-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
73 lines (68 loc) · 2.41 KB
/
index.html
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html><head>
</head>
<meta charset="utf-8">
<script src = "./p5/p5.js"></script>
<script src = "./p5/addons/p5.sound.js"></script>
<script src="./externalLibraries/p5.clickable.js"></script>
<style>
body {
margin: 0;
overflow: hidden;
justify-content: center;
align-items: center;
background-color: black;
}
</style>
<body>
<script>
let playBtn, optionsBtn, creditsBtn;
function preload(){
soundFormats('mp3', 'ogg');
mainMusic = loadSound('data/music/startScreenMusic');
bgd = loadImage("data/startScreen/background.png")
playImg = loadImage("data/startScreen/playBtn.png")
optionsImg = loadImage("data/startScreen/optionsBtn.png")
creditsImg = loadImage("data/startScreen/creditsBtn.png")
blink = loadSound('data/music/blink');
}
function setup(){
createCanvas(windowWidth, windowHeight);
playBtn = new Clickable(); // Crea il pulsante
playBtn.locate(windowWidth/2-250, windowHeight/2 - 130); // Imposta la posizione
playBtn.resize(500, 120); // Imposta le dimensioni
playBtn.image = playImg;
playBtn.text = ""
playBtn.onPress = function() {
blink.play();
window.location.href = "./game.html"
};
optionsBtn = new Clickable(); // Crea il pulsante
optionsBtn.locate(windowWidth/2-250, windowHeight/2 ); // Imposta la posizione
optionsBtn.resize(500, 120); // Imposta le dimensioni
optionsBtn.image = optionsImg;
optionsBtn.text = ""
optionsBtn.onPress = function() {
blink.play();
window.location.href = "./options.html"
};
creditsBtn = new Clickable(); // Crea il pulsante
creditsBtn.locate(windowWidth/2-250, windowHeight/2 + 130); // Imposta la posizione
creditsBtn.resize(500, 120); // Imposta le dimensioni
creditsBtn.image = creditsImg;
creditsBtn.text = ""
creditsBtn.onPress = function() {
blink.play();
window.location.href = "https://github.com/ITISlucaT/SereneLife"
};
bgd.resize(width, height)
mainMusic.loop()
}
function draw(){
image(bgd, 0, 0);
playBtn.draw();
optionsBtn.draw();
creditsBtn.draw();
}
</script>
</html>