make input_keyboard example speed a normal variable
This commit is contained in:
parent
b3a57c21a7
commit
fcecf78609
@ -27,14 +27,14 @@ fn move_on_input(
|
||||
println!("left just released");
|
||||
}
|
||||
|
||||
const SPEED: f32 = 3.0;
|
||||
let speed = 3.0;
|
||||
for (mut translation, _) in query.iter_mut(world) {
|
||||
if moving_left {
|
||||
translation.0 += math::vec3(SPEED, 0.0, 0.0) * time.delta_seconds;
|
||||
translation.0 += math::vec3(speed, 0.0, 0.0) * time.delta_seconds;
|
||||
}
|
||||
|
||||
if moving_right {
|
||||
translation.0 += math::vec3(-SPEED, 0.0, 0.0) * time.delta_seconds;
|
||||
translation.0 += math::vec3(-speed, 0.0, 0.0) * time.delta_seconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user