-
Notifications
You must be signed in to change notification settings - Fork 0
/
canvas.js
108 lines (80 loc) · 2 KB
/
canvas.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
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
var pantalla = document.querySelector("#ahorcado")
var pincel = pantalla.getContext("2d")
pincel.fillStyle= "grey"
function dibujarBase(){
pincel.beginPath();
pincel.moveTo(20, 350);
pincel.lineTo(300, 350);
pincel.lineTo(500,350)
pincel.lineWidth = 15;
pincel.strokeStyle = "#000"
pincel.stroke()
pincel.closePath();
}
function dibujarPoste(){
pincel.beginPath();
pincel.moveTo(150, 100);
pincel.lineTo(150, 100);
pincel.moveTo(150, 120);
pincel.lineTo(150, 100);
pincel.lineTo(50,100);
pincel.lineTo(50, 350);
pincel.lineWidth = 3;
pincel.strokeStyle = "#000"
pincel.stroke()
pincel.closePath();
}
function dibujarRostro(){
pincel.beginPath();
pincel.arc(150,150,35,0,Math.PI * 2, false);
pincel.strokeStyle = "red";
pincel.lineWidth = 5;
pincel.stroke();
pincel.closePath();
}
function dibujarTorzo(){
pincel.beginPath();
pincel.moveTo(150,180);
pincel.lineTo(150,250);
pincel.strokeStyle = "red";
pincel.lineWidth = 5;
pincel.stroke();
pincel.closePath()
}
function dibujarBrazos(){
pincel.beginPath();
pincel.moveTo(120,220);
pincel.lineTo(150,180);
pincel.lineTo(180,220)
pincel.strokeStyle = "red";
pincel.lineWidth = 5;
pincel.stroke();
pincel.closePath()
}
function dibujarPiernas(){
pincel.beginPath();
pincel.moveTo(120,290);
pincel.lineTo(150,250);
pincel.lineTo(180,290)
pincel.strokeStyle = "red";
pincel.lineWidth = 5;
pincel.stroke();
pincel.closePath()
}
function dibujarOjosMuertos(){
pincel.beginPath();
//ojo izquierdo
pincel.moveTo(125,120);
pincel.lineTo(145,145);
pincel.moveTo(145,120);
pincel.lineTo(125,145);
//ojo derecho
pincel.moveTo(155,120);
pincel.lineTo(175,145);
pincel.moveTo(175,120);
pincel.lineTo(155,145);
pincel.strokeStyle = "blue";
pincel.lineWidth = 5;
pincel.stroke();
pincel.closePath()
}