-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
147 lines (129 loc) · 3.47 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html>
<head>
<title>Banco Imobiliário (Escolha número de personagens)</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style/materialize/css/materialize.min.css">
<style type="text/css">
body
{
background-image: url("img/backgroundAleatorio1.jpeg");
background-repeat: no-repeat;
background-size: cover;
}
#div p
{
font-size: 20px;
}
#div p label span
{
font-size: 30px;
color: black;
}
</style>
<script type="text/javascript">
var nJogadores;
function lastNJogadores()
{
for (var i = 1; i <= 5; i++)
if(document.getElementById("nJogadores"+i).checked)
return i;
return 4;
}
function mudarNJogador(v)
{
nJogadores = v.value;
arrumarBotoes();
}
function arrumarBotoes()
{
if(nJogadores == 1)
{
document.getElementById("brBtnJogar").style.display = "none";
document.getElementById("btnJogar").style.display = "none";
}
else
{
document.getElementById("brBtnJogar").style.display = "inline-block";
document.getElementById("btnJogar").style.display = "inline-block";
}
if(nJogadores == 5)
document.getElementById("btnJogarComBots").style.display = "none";
else
{
document.getElementById("btnJogarComBots").innerHTML = "Preencher com " + (5 - nJogadores) + " Bot" + (nJogadores==4?"":"s") + " e jogar";
document.getElementById("btnJogarComBots").style.display = "inline-block";
}
}
function btnJogar_Click()
{
if(nJogadores == 1)
{
alert("u idiot");
document.getElementById("btnJogar").style.display = "none";
}
jogar(0);
}
function btnJogarComBots_Click()
{
if(nJogadores == 5)
{
alert("u idiot");
document.getElementById("btnJogarComBots").style.display = "none";
}
jogar(5 - nJogadores);
}
function jogar(qtdBots)
{
window.location = "jogo.html?nJogadores=" + nJogadores + "&nBots=" + qtdBots;
}
</script>
</head>
<body>
<center>
<b><h1>Banco Imobiliário - COTUCA</h1></b>
<div id="div">
<p>
<label>
<input onclick="mudarNJogador(this)" id="nJogadores1" value="1" class="with-gap" name="group1" type="radio" />
<span>Single Player</span>
</label>
</p>
<p>
<label>
<input onclick="mudarNJogador(this)" id="nJogadores2" value="2" class="with-gap" name="group1" type="radio" />
<span>2 Jogadores</span>
</label>
</p>
<p>
<label>
<input onclick="mudarNJogador(this)" id="nJogadores3" value="3" class="with-gap" name="group1" type="radio" />
<span>3 Jogadores</span>
</label>
</p>
<p>
<label>
<input onclick="mudarNJogador(this)" id="nJogadores4" value="4" class="with-gap" name="group1" type="radio" checked />
<span>4 Jogadores</span>
</label>
</p>
<p>
<label>
<input onclick="mudarNJogador(this)" id="nJogadores5" value="5" class="with-gap" name="group1" type="radio" />
<span>5 Jogadores</span>
</label>
</p>
</div>
<br>
<a id="btnJogar" onclick="btnJogar_Click()" class="waves-effect waves-light btn-large">Jogar (sem Bots)</a>
<br id="brBtnJogar">
<br>
<a id="btnJogarComBots" onclick="btnJogarComBots_Click()" class="waves-effect waves-light btn-large">Preencher com 1 Bot e jogar</a>
<script type="text/javascript">
nJogadores = lastNJogadores();
document.getElementById("nJogadores"+nJogadores).checked = true;
arrumarBotoes();
</script>
</center>
</body>
</html>