Skip to content

Commit 5d2e659

Browse files
committed
resolve merge conflict
2 parents e6ec900 + 5b256ce commit 5d2e659

40 files changed

Lines changed: 216 additions & 310 deletions

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
<!-- next-header -->
22
## [Unreleased] - ReleaseDate
33

4+
### BREAKING CHANGES
5+
6+
- `Game` is now generic over the user-provided game state struct, so the `init!` macro from the short-lived `3.0.0` version has been removed!
7+
8+
### Other Changes
9+
10+
- Upgraded to Bevy 0.6 in the back end
11+
- `Text` rotation and scale now works! 🎉
12+
- TODO: bevy_prototype_debug_lines hasn't had a release, and the `main` branch sorta works, but the lines now appear _under_ sprites instead of over them, which is not ideal. We _must_ have a release upstream and would _love_ a fix upstream. If there isn't an upstream release, we'll need to find another line-drawing solution before release.
13+
414
## [3.0.0] - 2021-12-30
515

616
### BREAKING CHANGES

Cargo.toml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,39 @@ readme = "README.md"
99
keywords = [ "game", "engine", "graphics", "audio", "rusty" ]
1010
categories = [ "game-engines" ]
1111
license = "MIT OR Apache-2.0"
12+
exclude = [
13+
"/assets",
14+
"/.github",
15+
"/scenarios",
16+
"/tutorial",
17+
"/script",
18+
"release.toml",
19+
"RELEASE.md",
20+
".gitignore",
21+
]
1222

1323
[dependencies]
14-
#bevy = { git = "https://github.com/bevyengine/bevy", rev = "47004dfcb415a049e4c6e68fdf56c26de72f51a1" }
15-
#bevy = { git = "https://github.com/bevyengine/bevy", branch = "main" }
16-
bevy = { version = "0.5", default-features = false, features = [
24+
bevy = { version = "0.6.0", default-features = false, features = [
1725
#"bevy_audio"
1826
"bevy_dynamic_plugin",
1927
"bevy_gilrs",
2028
"bevy_gltf",
21-
"bevy_wgpu",
2229
"bevy_winit",
2330
"render",
2431
"png",
2532
"hdr",
2633
"mp3",
2734
"x11",
2835
] }
29-
bevy_kira_audio = { version = "0.6.0", features = [
36+
bevy_kira_audio = { version = "0.8", features = [
3037
"flac",
3138
"mp3",
3239
"ogg",
3340
"wav",
3441
] }
35-
bevy_prototype_debug_lines = "0.3"
42+
#bevy_prototype_debug_lines = "0.3"
43+
#bevy_prototype_debug_lines = { version = "0.4.0", path = "../bevy_debug_lines" }
44+
bevy_prototype_debug_lines = { git = "https://github.com/Toqozz/bevy_debug_lines", branch = "bevy-main" }
3645
lazy_static = "1.4"
3746
log = "0.4"
3847
ron = "0.7"

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ Write your game!
7070
health: i32,
7171
}
7272

73-
// Initialize the engine with your custom struct
74-
rusty_engine::init!(GameState);
75-
7673
fn main() {
7774
// Create a game
7875
let mut game = Game::new();

examples/collider_creator.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! To run this code, clone the rusty_engine repository and run the command:
2-
//!
3-
//! cargo run --release --example collider_creator -- path/to/some_image.png
4-
//!
5-
//! ...where path/to/some_image.png is relative to assets/sprite/
2+
//!
3+
//! cargo run --release --example collider_creator path/to/some_image.png
4+
//!
5+
//! ...where that image is somewhere under assets/sprite
66
77
use std::path::PathBuf;
88

@@ -20,15 +20,13 @@ impl Default for GameState {
2020
}
2121
}
2222

23-
rusty_engine::init!(GameState);
24-
2523
fn main() {
2624
// We need an image file to work with, so the user must pass in the path of an image
2725
let args = std::env::args().skip(1).collect::<Vec<_>>();
2826
if args.len() != 1 {
2927
println!(
3028
"Please pass in the path of an image inside the `assets/sprite` directory! For example:\n\
31-
cargo run --release --example collider_creator -- racing/car_green.png"
29+
cargo run --release --example collider_creator assets/sprite/racing/car_green.png"
3230
);
3331
std::process::exit(1);
3432
}
@@ -43,7 +41,7 @@ fn main() {
4341
.unwrap()
4442
.to_path_buf();
4543
}
46-
if !(PathBuf::from("assets").join(&path)).exists() {
44+
if !(PathBuf::from("assets/sprite").join(&path)).exists() {
4745
println!("Couldn't find the file {}", path.to_string_lossy());
4846
std::process::exit(1);
4947
}

examples/collision.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
55
use rusty_engine::prelude::*;
66

7-
rusty_engine::init!();
8-
97
const ROTATION_SPEED: f32 = 3.0;
108

119
fn main() {

examples/game_state.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ struct MyCustomGameStateStuff {
1515
turning: bool,
1616
}
1717

18-
// Pass your custom struct to the init macro
19-
rusty_engine::init!(MyCustomGameStateStuff);
20-
2118
fn main() {
2219
let mut game = Game::new();
2320
let _ = game.add_sprite("Race Car", SpritePreset::RacingCarGreen);

examples/keyboard_events.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
55
use rusty_engine::prelude::*;
66

7-
rusty_engine::init!();
8-
97
fn main() {
108
let mut game = Game::new();
119

examples/keyboard_state.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ use std::f32::consts::PI;
66

77
use rusty_engine::prelude::*;
88

9-
rusty_engine::init!();
10-
119
fn main() {
1210
let mut game = Game::new();
1311

examples/layer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
55
use rusty_engine::prelude::*;
66

7-
rusty_engine::init!();
8-
97
fn main() {
108
let mut game = Game::new();
119

examples/level_creator.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ impl Default for GameState {
2424
}
2525
}
2626

27-
rusty_engine::init!(GameState);
28-
2927
const MAX_LAYER: f32 = 900.0;
3028

3129
fn main() {
@@ -122,7 +120,7 @@ fn logic(engine_state: &mut EngineState, game_state: &mut GameState) -> bool {
122120
// Print out the level?
123121
if print_level {
124122
println!(
125-
"---------------\n\nuse rusty_engine::prelude::*;\n\nstruct GameState {{}}\n\nrusty_engine::init!(GameState);\n\nfn main() {{\n let mut game = Game::new();\n"
123+
"---------------\n\nuse rusty_engine::prelude::*;\n\nstruct GameState {{}}\n\nfn main() {{\n let mut game = Game::new();\n"
126124
);
127125
for sprite in engine_state.sprites.values() {
128126
if sprite.label == game_state.current_label {
@@ -208,7 +206,15 @@ fn logic(engine_state: &mut EngineState, game_state: &mut GameState) -> bool {
208206
.enumerate()
209207
.find(|(_, preset)| preset.filepath() == old_sprite.filepath)
210208
.unwrap();
211-
let new_idx = (idx + 1) % SpritePreset::variant_iter().count();
209+
let new_idx = if next_preset {
210+
(idx + 1) % SpritePreset::variant_iter().count()
211+
} else {
212+
if idx == 0 {
213+
SpritePreset::variant_iter().count() - 1
214+
} else {
215+
idx - 1
216+
}
217+
};
212218
let new_preset = SpritePreset::variant_iter().nth(new_idx).unwrap();
213219

214220
let new_label = game_state.next_sprite_num.to_string();

0 commit comments

Comments
 (0)