Skip to content

Commit cc382c3

Browse files
authored
Merge pull request #519 from 0awful/simplify-vectors
simplify vector call
2 parents 9816e48 + 57a65f0 commit cc382c3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/dodge-the-creeps/rust/src/main_scene.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ impl Main {
100100
rng.gen_range(mob.min_speed..mob.max_speed)
101101
};
102102

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);
103+
mob.set_linear_velocity(Vector2::new(range, 0.0).rotated(real::from_f32(direction)));
106104

107105
let mut hud = self.base.get_node_as::<Hud>("Hud");
108106
hud.connect("start_game".into(), mob.callable("on_start_game"));

0 commit comments

Comments
 (0)