-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
56 lines (49 loc) · 1.17 KB
/
index.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
function iniciar() {
var canvas = document.getElementById("myCanvas");
if (canvas.getContext) {
var ctx = canvas.getContext("2d");
}
mainMenu();
}
//Al dar click en jugar, creditos y puntajes, aparecen o desaparecen los objetos
function mainMenu() {
$('#main').show();
$('#players').hide();
$('#game-over').hide();
$('#credits').hide();
$('#scores').hide();
$('#myCanvas').hide();
$('#menu').addClass('main');
}
$('.credits').click(function () {
$('#main').hide();
$('#credits').show();
$('#menu').addClass('credits');
});
$('.back').click(function () {
$('#credits').hide();
$('#main').show();
$('#menu').removeClass('back');
});
$('.backGame').click(function () {
$('#players').hide();
$('#main').show();
$('#myCanvas').hide();
$('#menu').removeClass('backGame');
});
$('.play').click(function () {
$('#main').hide();
$('#players').show();
$('#myCanvas').show();
$('#menu').addClass('play');
});
$('.scores').click(function () {
$('#main').hide();
$('#scores').show();
$('#menu').addClass('scores');
});
$('.backScores').click(function () {
$('#scores').hide();
$('#main').show();
$('#menu').removeClass('backScores');
});