From ddb714132493ddba75d1e6adcdb44cae9067b505 Mon Sep 17 00:00:00 2001 From: alestiago Date: Wed, 23 Mar 2022 09:59:12 +0000 Subject: [PATCH] feat: adjusted motor values --- lib/game/components/chrome_dino.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/game/components/chrome_dino.dart b/lib/game/components/chrome_dino.dart index 1ab2260b..68d2956e 100644 --- a/lib/game/components/chrome_dino.dart +++ b/lib/game/components/chrome_dino.dart @@ -56,7 +56,7 @@ class ChromeDino extends BodyComponent with InitialPosition { final box = PolygonShape()..setAsBoxXY(size.x / 2, size.y / 2); final fixtureDef = FixtureDef(box) ..shape = box - ..density = 1 + ..density = 999 ..friction = 0.3 ..restitution = 0.1 ..isSensor = true; @@ -139,15 +139,14 @@ class _ChromeDinoAnchorRevoluteJointDef extends RevoluteJointDef { enableMotor = true; // TODO(alestiago): Tune this values. - maxMotorTorque = 999; - motorSpeed = 999; + maxMotorTorque = motorSpeed = chromeDino.body.mass * 30; } } class _ChromeDinoJoint extends RevoluteJoint { _ChromeDinoJoint(_ChromeDinoAnchorRevoluteJointDef def) : super(def) { _timer = Timer.periodic( - const Duration(milliseconds: 100), + const Duration(seconds: 1), (_) => _swivel(), ); }