-
Notifications
You must be signed in to change notification settings - Fork 0
/
block_data.lua
143 lines (127 loc) · 2.75 KB
/
block_data.lua
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
local block_data = {}
default_box_half_multipliers = { u=1, d=1, l=1, r=1 }
function block_data.get_box_half_multipliers(type)
if block_data[type].box_half_multipliers then
return block_data[type].box_half_multipliers
else
return default_box_half_multipliers
end
end
block_data["void"] =
{
hp = 0,
breakable = false,
collision_type = "solid",
slope = false,
}
block_data["air"] =
{
hp = 0,
breakable = false,
collision_type = "empty",
slope = false,
invisible = true,
}
block_data["wall"] =
{
hp = 180,
breakable = true,
collision_type = "solid",
slope = false,
}
block_data["slope_45"] =
{
hp = 120,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = true, l = false, r = true},
slope = -1,
slope_y_offset = 0,
}
block_data["slope_-45"] =
{
hp = 120,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = true, l = true, r = false},
slope = 1,
slope_y_offset = 0,
}
block_data["slope_45_a"] =
{
hp = 60,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = false, l = false, r = false},
slope = -1,
slope_y_offset = 16,
box_half_multipliers = { u = 0, d = 1, l = 0, r = 1 },
}
block_data["slope_45_b"] =
{
hp = 120,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = true, l = false, r = true},
slope = -1,
slope_y_offset = -16,
}
block_data["slope_-45_a"] =
{
hp = 60,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = false, l = false, r = false},
slope = 1,
slope_y_offset = 16,
box_half_multipliers = { u = 0, d = 1, l = 1, r = 0 },
}
block_data["slope_-45_b"] =
{
hp = 120,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = true, l = true, r = false},
slope = 1,
slope_y_offset = -16,
}
-- 23 degree slopes are offset one pixel downwards to avoid jamming the player into a wall in acute corners
block_data["slope_23_a"] =
{
hp = 60,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = true, l = false, r = false},
slope = -0.5,
slope_y_offset = 8,
box_half_multipliers = { u = 0, d = 1, l = 1, r = 1 },
}
block_data["slope_23_b"] =
{
hp = 120,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = true, l = false, r = true},
slope = -0.5,
slope_y_offset = -8,
}
block_data["slope_-23_a"] =
{
hp = 60,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = true, l = false, r = false},
slope = 0.5,
slope_y_offset = 8,
box_half_multipliers = { u = 0, d = 1, l = 1, r = 1 },
}
block_data["slope_-23_b"] =
{
hp = 120,
breakable = true,
collision_type = "slope",
collision_dirs = { u = false, d = true, l = true, r = false},
slope = 0.5,
slope_y_offset = -8,
}
return block_data