-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to Bevy 0.13 #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could just change the bevy versions to exclude the patch version, I'll merge this.
(Removing Vec3::from
and adding the dereference would be nice for code quality, but not necessary)
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, just reviewing to give this more relevancy again.
All of my review comments should be considered non-blocking, feel free to ignore.
Overall, clean update 👍🏼
let forward = if keys.pressed(KeyCode::KeyW) { | ||
1f32 | ||
} else { | ||
0f32 | ||
}; | ||
|
||
let backward = if keys.pressed(KeyCode::KeyS) { | ||
1f32 | ||
} else { | ||
0f32 | ||
}; | ||
|
||
let right = if keys.pressed(KeyCode::KeyD) { | ||
1f32 | ||
} else { | ||
0f32 | ||
}; | ||
|
||
let left = if keys.pressed(KeyCode::KeyA) { | ||
1f32 | ||
} else { | ||
0f32 | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeating the same pattern quiet often. You could use condition as usize as f32
for an easy condition but I think that's a bit implicit so maybe something like
fn one_if_true(condition: bool) { if condition { 1.0 } else { 0.0 } }
let backward = one_if_true(keys.pressed(KeyCode::KeyS));
let right = one_if_true(keys.pressed(KeyCode::KeyD));
let left = one_if_true(keys.pressed(KeyCode::KeyA));
let forward = one_if_true(keys.pressed(KeyCode::KeyW));
would be more clean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer the current implementation.
No description provided.