Update lib/game/components/crossing_ramp.dart

Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com>
pull/40/head
Rui Miguel Alonso 4 years ago committed by GitHub
parent ac17e5151c
commit 5988638c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -77,17 +77,16 @@ abstract class RampArea extends BodyComponent {
@override @override
Body createBody() { Body createBody() {
final fixtureDef = FixtureDef(shape)..isSensor = true; final fixtureDef = FixtureDef(shape)
..isSensor = true
..filter.categoryBits = _categoryBits;
final bodyDef = BodyDef() final bodyDef = BodyDef()
..userData = this ..userData = this
..position = _position ..position = _position
..type = BodyType.static; ..type = BodyType.static;
final body = world.createBody(bodyDef); return world.createBody(bodyDef)..createFixture(fixtureDef);
body.createFixture(fixtureDef).filterData.categoryBits = _categoryBits;
return body;
} }
} }

Loading…
Cancel
Save