mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
make input_keyboard example speed a normal variable
This commit is contained in:
parent
b3a57c21a7
commit
fcecf78609
1 changed files with 3 additions and 3 deletions
|
@ -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 a new issue