Skip to content
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

Merged
merged 8 commits into from
Feb 23, 2024
Merged

Update to Bevy 0.13 #12

merged 8 commits into from
Feb 23, 2024

Conversation

VirxEC
Copy link
Contributor

@VirxEC VirxEC commented Feb 18, 2024

No description provided.

Copy link
Owner

@JonahPlusPlus JonahPlusPlus left a 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)

Cargo.toml Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@VirxEC
Copy link
Contributor Author

VirxEC commented Feb 19, 2024

Done

Copy link

@RobWalt RobWalt left a 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 👍🏼

Comment on lines +149 to +171
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
};
Copy link

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?

Copy link
Collaborator

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.

examples/3d_scene.rs Outdated Show resolved Hide resolved
@Shatur Shatur merged commit 25233da into JonahPlusPlus:master Feb 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants