-
Notifications
You must be signed in to change notification settings - Fork 0
/
canvas.js
65 lines (54 loc) · 1.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
const pantalla = document.querySelector("canvas");
const pincel = pantalla.getContext("2d");
pincel.strokeStyle = "#0A3871";
pincel.lineWidth = 6;
pincel.lineCap = "round";
pincel.font = "40px sans-serif";
function dibujarHorca() {
pincel.beginPath();
pincel.moveTo(200, 300);
pincel.lineTo(400, 300);
pincel.stroke();
pincel.moveTo(250, 300);
pincel.lineTo(250, 10);
pincel.stroke();
pincel.lineTo(375, 10);
pincel.stroke();
pincel.lineTo(375, 50);
pincel.stroke();
}
function dibujarCabeza() {
pincel.beginPath();
pincel.arc(375, 70, 20, 0, 2 * Math.PI);
pincel.stroke();
}
function dibujarCuerpo() {
pincel.beginPath();
pincel.moveTo(375, 90);
pincel.lineTo(375, 180);
pincel.stroke();
}
function dibujarBrazoIzquierdo() {
pincel.beginPath();
pincel.moveTo(375, 100);
pincel.lineTo(350, 140);
pincel.stroke();
}
function dibujarBrazoDerecho() {
pincel.beginPath();
pincel.moveTo(375, 100);
pincel.lineTo(400, 140);
pincel.stroke();
}
function dibujarPiernaDerecha() {
pincel.beginPath();
pincel.moveTo(375, 180);
pincel.lineTo(400, 230);
pincel.stroke();
}
function dibujarPiernaIzquierda() {
pincel.beginPath();
pincel.moveTo(375, 180);
pincel.lineTo(350, 230);
pincel.stroke();
}