We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9816e48 + 57a65f0 commit cc382c3Copy full SHA for cc382c3
examples/dodge-the-creeps/rust/src/main_scene.rs
@@ -100,9 +100,7 @@ impl Main {
100
rng.gen_range(mob.min_speed..mob.max_speed)
101
};
102
103
- mob.set_linear_velocity(Vector2::new(range, 0.0));
104
- let lin_vel = mob.get_linear_velocity().rotated(real::from_f32(direction));
105
- mob.set_linear_velocity(lin_vel);
+ mob.set_linear_velocity(Vector2::new(range, 0.0).rotated(real::from_f32(direction)));
106
107
let mut hud = self.base.get_node_as::<Hud>("Hud");
108
hud.connect("start_game".into(), mob.callable("on_start_game"));
0 commit comments