-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplatforms.lua
More file actions
140 lines (102 loc) · 4.84 KB
/
platforms.lua
File metadata and controls
140 lines (102 loc) · 4.84 KB
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
-- This file is for use with Corona(R) SDK
--
-- This file is automatically generated with PhysicsEdtior (http://physicseditor.de). Do not edit
--
-- Usage example:
-- local scaleFactor = 1.0
-- local physicsData = (require "shapedefs").physicsData(scaleFactor)
-- local shape = display.newImage("objectname.png")
-- physics.addBody( shape, physicsData:get("objectname") )
--
-- copy needed functions to local scope
local unpack = unpack
local pairs = pairs
local ipairs = ipairs
local M = {}
function M.physicsData(scale)
local physics = { data =
{
["float17"] = {
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 4, maskBits = 2, groupIndex = 0 },
shape = { -225, -92.5 , -226, -51.5 , -539, -42.5 , -538, -106.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 4, maskBits = 2, groupIndex = 0 },
shape = { 528, -16.5 , -539, -42.5 , -226, -51.5 , 543, -43.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 128, maskBits = 0, groupIndex = 0 },
shape = { 38, -186.5 , 38, -226.5 , 78, -226.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 128, maskBits = 0, groupIndex = 0 },
shape = { 505, -103.5 , 505, -143.5 , 545, -143.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 128, maskBits = 0, groupIndex = 0 },
shape = { -382, -158.5 , -382, -198.5 , -342, -198.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 2, groupIndex = 0 },
shape = { -533, -41.5 , -434, -6.5 , -502, 20.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 2, groupIndex = 0 },
shape = { -109, 55.5 , 129, 28.5 , -29, 120.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 2, groupIndex = 0 },
shape = { -434, -6.5 , 129, 28.5 , -277, 72.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 2, groupIndex = 0 },
shape = { 129, 28.5 , 496, -15.5 , 281, 52.5 }
}
,
{
pe_fixture_id = "", density = 2, friction = 0, bounce = 0,
filter = { categoryBits = 1, maskBits = 2, groupIndex = 0 },
shape = { 129, 28.5 , -434, -6.5 , -533, -41.5 , 496, -15.5 }
}
}
} }
-- apply scale factor
local s = scale or 1.0
for bi,body in pairs(physics.data) do
for fi,fixture in ipairs(body) do
if(fixture.shape) then
for ci,coordinate in ipairs(fixture.shape) do
fixture.shape[ci] = s * coordinate
end
else
fixture.radius = s * fixture.radius
end
end
end
function physics:get(name)
return unpack(self.data[name])
end
function physics:getFixtureId(name, index)
return self.data[name][index].pe_fixture_id
end
return physics;
end
return M