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.11 #34

Merged
merged 1 commit into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_flycam"
version = "0.10.1"
version = "0.11.0"
authors = ["Spencer Burris <[email protected]>"]
edition = "2021"
license = "ISC"
Expand All @@ -13,7 +13,7 @@ categories = ["game-engines", "game-development"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = { version = "0.10", default-features = false, features = ["bevy_render", "bevy_core_pipeline", "bevy_asset"] }
bevy = { version = "0.11", default-features = false, features = ["bevy_render", "bevy_core_pipeline", "bevy_asset"] }

[dev-dependencies]
bevy = { version = "0.10", default-features = false, features = ["x11", "wayland", "bevy_pbr", "bevy_core_pipeline", "bevy_asset"] }
bevy = { version = "0.11", default-features = false, features = ["x11", "wayland", "bevy_pbr", "bevy_core_pipeline", "bevy_asset"] }
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![Crates.io](https://img.shields.io/crates/l/bevy_flycam)
![docs.rs](https://img.shields.io/docsrs/bevy_flycam)

A basic first-person fly camera for Bevy 0.10
A basic first-person fly camera for Bevy 0.11

## Controls

Expand All @@ -29,15 +29,15 @@ There are a few notable differences from [bevy_fly_camera](https://github.com/mc

```toml
[dependencies]
bevy = "0.10"
bevy = "0.11"
bevy_flycam = "*"
```

or

```toml
[dependencies]
bevy = "0.10"
bevy = "0.11"
bevy_flycam = { git = "https://github.com/sburris0/bevy_flycam" }
```

Expand All @@ -57,7 +57,7 @@ There are a few notable differences from [bevy_fly_camera](https://github.com/mc
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(PlayerPlugin)
.add_plugins(PlayerPlugin)
.run();
}
```
Expand All @@ -75,7 +75,7 @@ Same thing goes for the keybindings used for moving the camera.
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(PlayerPlugin)
.add_plugins(PlayerPlugin)
.insert_resource(MovementSettings {
sensitivity: 0.00015, // default: 0.00012
speed: 12.0, // default: 12.0
Expand All @@ -96,6 +96,7 @@ fn main() {
bevy_flycam's crate version follows bevy's minor version as shown:
| bevy | bevy_flycam |
| :-- | :-- |
| `0.11.0` | `0.11.0` |
| `0.10.1` | `0.10.1` |

## Contributing
Expand Down
4 changes: 2 additions & 2 deletions examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ fn main() {
App::new()
.insert_resource(Msaa::Sample4)
.add_plugins(DefaultPlugins)
.add_plugin(PlayerPlugin)
.add_plugins(PlayerPlugin)
.insert_resource(MovementSettings {
sensitivity: 0.00015, // default: 0.00012
speed: 12.0, // default: 12.0
})
.add_system(setup.on_startup())
.add_systems(Startup, setup)
.run();
}

Expand Down
4 changes: 2 additions & 2 deletions examples/key_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn main() {
App::new()
.insert_resource(Msaa::Sample4)
.add_plugins(DefaultPlugins)
.add_plugin(PlayerPlugin)
.add_plugins(PlayerPlugin)
.insert_resource(MovementSettings {
sensitivity: 0.00015, // default: 0.00012
speed: 12.0, // default: 12.0
Expand All @@ -19,7 +19,7 @@ fn main() {
move_descend: KeyCode::Q,
..Default::default()
})
.add_startup_system(setup)
.add_systems(Startup, setup)
.run();
}

Expand Down
12 changes: 6 additions & 6 deletions examples/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ fn main() {
.insert_resource(Msaa::Sample4)
.add_plugins(DefaultPlugins)
//NoCameraPlayerPlugin as we provide the camera
.add_plugin(NoCameraPlayerPlugin)
.add_plugins(NoCameraPlayerPlugin)
.insert_resource(MovementSettings {
..Default::default()
})
// Setting initial state
.add_state::<ScrollType>()
.add_system(setup.on_startup())
.add_system(switch_scroll_type)
.add_system(scroll)
.add_systems(Startup, setup)
.add_systems(Update, switch_scroll_type)
.add_systems(Update, scroll)
.run();
}

Expand Down Expand Up @@ -78,7 +78,7 @@ fn switch_scroll_type(
keyboard_input: Res<Input<KeyCode>>,
) {
if keyboard_input.just_pressed(KeyCode::Z) {
let result = match scroll_type.0 {
let result = match scroll_type.get() {
ScrollType::MovementSpeed => ScrollType::Zoom,
ScrollType::Zoom => ScrollType::MovementSpeed,
};
Expand All @@ -96,7 +96,7 @@ fn scroll(
mut query: Query<(&FlyCam, &mut Projection)>,
) {
for event in mouse_wheel_events.iter() {
if scroll_type.0 == ScrollType::MovementSpeed {
if *scroll_type.get() == ScrollType::MovementSpeed {
settings.speed = (settings.speed + event.y * 0.1).abs();
println!("Speed: {:?}", settings.speed);
} else {
Expand Down
22 changes: 11 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Default for KeyBindings {
move_left: KeyCode::A,
move_right: KeyCode::D,
move_ascend: KeyCode::Space,
move_descend: KeyCode::LShift,
move_descend: KeyCode::ShiftLeft,
toggle_grab_cursor: KeyCode::Escape,
}
}
Expand Down Expand Up @@ -212,11 +212,11 @@ impl Plugin for PlayerPlugin {
app.init_resource::<InputState>()
.init_resource::<MovementSettings>()
.init_resource::<KeyBindings>()
.add_system(setup_player.on_startup())
.add_system(initial_grab_cursor.on_startup())
.add_system(player_move)
.add_system(player_look)
.add_system(cursor_grab);
.add_systems(Startup, setup_player)
.add_systems(Startup, initial_grab_cursor)
.add_systems(Update, player_move)
.add_systems(Update, player_look)
.add_systems(Update, cursor_grab);
}
}

Expand All @@ -227,10 +227,10 @@ impl Plugin for NoCameraPlayerPlugin {
app.init_resource::<InputState>()
.init_resource::<MovementSettings>()
.init_resource::<KeyBindings>()
.add_system(initial_grab_cursor.on_startup())
.add_system(initial_grab_on_flycam_spawn.on_startup())
.add_system(player_move)
.add_system(player_look)
.add_system(cursor_grab);
.add_systems(Startup, initial_grab_cursor)
.add_systems(Startup, initial_grab_on_flycam_spawn)
.add_systems(Update, player_move)
.add_systems(Update, player_look)
.add_systems(Update, cursor_grab);
}
}
Loading