Skip to content

Commit 1c8cc36

Browse files
authored
Merge pull request #240 from 133794m3r/box2d-add-all-bodies
Box2d Add all Body Types to the properties.
2 parents cb8f2f9 + 081f1a2 commit 1c8cc36

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

sti/plugins/box2d.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,15 @@ return {
3838
end
3939

4040
local currentBody = body
41-
41+
--dynamic are objects/players etc.
4242
if userdata.properties.dynamic == true then
4343
currentBody = love.physics.newBody(world, map.offsetx, map.offsety, 'dynamic')
44+
-- static means it shouldn't move. Things like walls/ground.
45+
elseif userdata.properties.static == true then
46+
currentBody = love.physics.newBody(world, map.offsetx, map.offsety, 'static')
47+
-- kinematic means that the object is static in the game world but effects other bodies
48+
elseif userdata.properties.kinematic == true then
49+
currentBody = love.physics.newBody(world, map.offsetx, map.offsety, 'kinematic')
4450
end
4551

4652
local fixture = love.physics.newFixture(currentBody, shape)

0 commit comments

Comments
 (0)