Skip to content

Commit 680247f

Browse files
authored
Merge pull request #31 from BlackPhlox/no_player_plugin_fix
2 parents 68eafb4 + c3e57a0 commit 680247f

File tree

3 files changed

+41
-29
lines changed

3 files changed

+41
-29
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bevy_flycam"
3-
version = "0.10.0"
3+
version = "0.10.1"
44
authors = ["Spencer Burris <sburris@posteo.net>"]
55
edition = "2021"
66
license = "ISC"

README.md

+39-28
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# bevy_flycam
2+
23
[![Crates.io](https://img.shields.io/crates/v/bevy_flycam)](https://crates.io/crates/bevy_flycam)
34
![Crates.io](https://img.shields.io/crates/l/bevy_flycam)
45
![docs.rs](https://img.shields.io/docsrs/bevy_flycam)
56

6-
77
A basic first-person fly camera for Bevy 0.10
88

99
## Controls
10+
1011
* WASD to move horizontally
1112
* SPACE to ascend
1213
* LSHIFT to descend
1314
* ESC to grab/release cursor.
1415

1516
## Comparison
17+
1618
There are a few notable differences from [bevy_fly_camera](https://github.com/mcpar-land/bevy_fly_camera)...
1719

1820
* No linear interpolation
@@ -22,45 +24,52 @@ There are a few notable differences from [bevy_fly_camera](https://github.com/mc
2224
* A tiny bit faster?
2325

2426
## Usage
27+
2528
1. Add to `Cargo.toml` or copy `lib.rs` to your own file
26-
```toml
27-
[dependencies]
28-
bevy = "0.10"
29-
bevy_flycam = "*"
30-
```
3129

32-
or
30+
```toml
31+
[dependencies]
32+
bevy = "0.10"
33+
bevy_flycam = "*"
34+
```
3335

34-
```toml
35-
[dependencies]
36-
bevy = "0.10"
37-
bevy_flycam = { git = "https://github.com/sburris0/bevy_flycam" }
38-
```
36+
or
37+
38+
```toml
39+
[dependencies]
40+
bevy = "0.10"
41+
bevy_flycam = { git = "https://github.com/sburris0/bevy_flycam" }
42+
```
3943

4044
2. Include the prelude:
41-
```rust
42-
use bevy_flycam::prelude::*;
43-
```
44-
This will spawn a camera for you.
45-
Use `NoCameraPlayerPlugin` if you do not want this and make sure to use `.insert(FlyCam)` on your own camera or else this plugin won't know what to move.
45+
46+
```rust
47+
use bevy_flycam::prelude::*;
48+
```
49+
50+
This will spawn a camera for you.
51+
Use `NoCameraPlayerPlugin` if you do not want this and make sure to use `.insert(FlyCam)` on your own camera or else this plugin won't know what to move.
4652

4753
3. Add the `PlayerPlugin`:
48-
```rust
49-
#[bevy_main]
50-
fn main() {
51-
App::new()
52-
.add_plugins(DefaultPlugins)
53-
.add_plugin(PlayerPlugin)
54-
.run();
55-
}
56-
```
54+
55+
```rust
56+
#[bevy_main]
57+
fn main() {
58+
App::new()
59+
.add_plugins(DefaultPlugins)
60+
.add_plugin(PlayerPlugin)
61+
.run();
62+
}
63+
```
5764

5865
Alternatively you can see the example `basic.rs` or `scroll.rs` located in the examples folder.
5966
You can run the example by cloning this repository and run the command: `cargo run --release --example basic`
6067

6168
## Customization
69+
6270
To modify player movement speed or mouse sensitivity add it as a resource. </br>
6371
Same thing goes for the keybindings used for moving the camera.
72+
6473
```Rust
6574
#[bevy_main]
6675
fn main() {
@@ -80,13 +89,15 @@ fn main() {
8089
}
8190
```
8291

83-
# Support
92+
## Support
93+
8494
[![Bevy tracking](https://img.shields.io/badge/Bevy%20tracking-released%20version-lightblue)](https://github.com/bevyengine/bevy/blob/main/docs/plugins_guidelines.md#main-branch-tracking)
8595

8696
bevy_flycam's crate version follows bevy's minor version as shown:
8797
| bevy | bevy_flycam |
8898
| :-- | :-- |
89-
| `0.10.X` | `0.10` |
99+
| `0.10.1` | `0.10.1` |
90100

91101
## Contributing
102+
92103
PRs are very welcome.

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ impl Plugin for NoCameraPlayerPlugin {
227227
app.init_resource::<InputState>()
228228
.init_resource::<MovementSettings>()
229229
.init_resource::<KeyBindings>()
230+
.add_system(initial_grab_cursor.on_startup())
230231
.add_system(initial_grab_on_flycam_spawn.on_startup())
231232
.add_system(player_move)
232233
.add_system(player_look)

0 commit comments

Comments
 (0)