From 5e630fbd360181dccbe1e54793bf218e4124614d Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Tue, 8 Dec 2020 22:47:28 -0500 Subject: add friction to platforms --- sim.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sim.cpp b/sim.cpp index 49fc9d9..7add4e9 100644 --- a/sim.cpp +++ b/sim.cpp @@ -247,7 +247,12 @@ static void platform_make_body(State *state, Platform *platform) { b2PolygonShape shape; shape.SetAsBox(half_size, state->platform_thickness); - body->CreateFixture(&shape, 0.0f); + + b2FixtureDef fixture; + fixture.shape = &shape; + fixture.friction = 0.8f; + + body->CreateFixture(&fixture); if (platform->moves) { float speed = platform->move_speed; v2 p1 = platform->move_p1, p2 = platform->move_p2; -- cgit v1.2.3