From 5988638c67b32024763b16900d0c301349d1cd87 Mon Sep 17 00:00:00 2001 From: Rui Miguel Alonso Date: Mon, 14 Mar 2022 18:46:23 +0100 Subject: [PATCH] Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> --- lib/game/components/crossing_ramp.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/game/components/crossing_ramp.dart b/lib/game/components/crossing_ramp.dart index 8d9acd3a..a039d58e 100644 --- a/lib/game/components/crossing_ramp.dart +++ b/lib/game/components/crossing_ramp.dart @@ -77,17 +77,16 @@ abstract class RampArea extends BodyComponent { @override Body createBody() { - final fixtureDef = FixtureDef(shape)..isSensor = true; + final fixtureDef = FixtureDef(shape) + ..isSensor = true + ..filter.categoryBits = _categoryBits; final bodyDef = BodyDef() ..userData = this ..position = _position ..type = BodyType.static; - final body = world.createBody(bodyDef); - body.createFixture(fixtureDef).filterData.categoryBits = _categoryBits; - - return body; + return world.createBody(bodyDef)..createFixture(fixtureDef); } }