-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblocks.c
98 lines (78 loc) · 1.81 KB
/
blocks.c
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
#include "blocks.h"
#include <stdlib.h>
#include <math.h>
Block get_house() {
Line* house = (Line*)malloc(sizeof(Line) * HOUSE_LINE_CO);
// Outline
house[0].a.x = -10;
house[0].a.y = 30;
house[0].b.x = 10;
house[0].b.y = 30;
house[1].a.x = 10;
house[1].a.y = 30;
house[1].b.x = 10;
house[1].b.y = 0;
house[2].a.x = 10;
house[2].a.y = 0;
house[2].b.x = -10;
house[2].b.y = 0;
house[3].a.x = -10;
house[3].a.y = 0;
house[3].b.x = -10;
house[3].b.y = 30;
// Windows
house[4].a.x = -10;
house[4].a.y = 10;
house[4].b.x = 10;
house[4].b.y = 10;
house[5].a.x = -10;
house[5].a.y = 20;
house[5].b.x = 10;
house[5].b.y = 20;
house[6].a.x = -2;
house[6].a.y = 10;
house[6].b.x = -2;
house[6].b.y = 20;
house[7].a.x = 2;
house[7].a.y = 10;
house[7].b.x = 2;
house[7].b.y = 20;
house[8].a.x = -6;
house[8].a.y = 10;
house[8].b.x = -6;
house[8].b.y = 20;
house[9].a.x = -6;
house[9].a.y = 15;
house[9].b.x = -2;
house[9].b.y = 15;
house[10].a.x = 6;
house[10].a.y = 10;
house[10].b.x = 6;
house[10].b.y = 20;
house[10].a.x = 2;
house[10].a.y = 15;
house[10].b.x = 10;
house[10].b.y = 15;
Block b = {HOUSE_LINE_CO, house};
return b;
}
Block get_crane() {
Line* crane = (Line*)malloc(sizeof(Line) * CRANE_LINE_CO);
// Crane rope
crane[0].a.x = 0;
crane[0].a.y = 0;
crane[0].b.x = 0;
crane[0].b.y = 15;
Block b = {CRANE_LINE_CO, crane};
return b;
}
Block get_ground() {
Line* ground = (Line*)malloc(sizeof(Line) * GROUND_LINE_CO);
// Ground
ground[0].a.x = -32;
ground[0].a.y = 0;
ground[0].b.x = 32;
ground[0].b.y = 0;
Block b = {GROUND_LINE_CO, ground};
return b;
}