-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtra - Pac-Man.html
57 lines (47 loc) · 1.24 KB
/
Extra - Pac-Man.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
<canvas width="1000" height="450"></canvas>
<body>
<script src="Ferramentas de desenho.js"></script>
<script>
// Seletor de tela
var tela = document.querySelector('canvas');
var desenho = tela.getContext('2d');
function Circulo(xc,yc,r,fundo,textoF,linha,textoL)
{
var tela = document.querySelector('canvas');
var desenho = tela.getContext('2d');
inicio();
arco(xc,yc,r, 0, 2*3.14);
if (textoF == true && textoL == false) {
cor(fundo);
pintar();
}
if (textoF == false && textoL == true) {
corLinha(linha);
contorno();
}
if (textoF == true && textoL == true) {
cor(fundo);
pintar();
corLinha(linha);
contorno();
}
}
// PAC-MAN
cor('blue')
pintarRet(0, 0, 1000, 500)
var e = 10;
inicio(); // corpo
cor('yellow')
ponto(200 + e, 200 + e); linha(141.42, 141.42);
arco(200 + e, 200 + e, 200, 3.14/4, (7*3.14)/4, false);
linha(200 + e, 200 + e);
pintar();
inicio() // olhos
arco(200 + e, 100 + e, 25, 0, 2*3.14);
cor('black');
pintar();
var xc = 300; // esferas de energia
for(var i = 0; i <= 900; i = i+150)
{ Circulo(xc+i,200+e,50, 'white', true, 'black', false) }
</script>
</body>