You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+37-35Lines changed: 37 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
<!-- next-header -->
2
+
2
3
## [Unreleased] - ReleaseDate
3
4
4
5
## Added
@@ -17,7 +18,6 @@
17
18
18
19
- Updated to `bevy 0.8` and `bevy_prototype_lyon 0.6` under the hood, which resolves the occasional stuttering problem.
19
20
20
-
21
21
## [5.1.0] - 2022-06-18
22
22
23
23
### Improved
@@ -118,58 +118,58 @@ Yes, I know I shouldn't be releasing breaking changes in a patch release...but n
118
118
### BREAKING CHANGES
119
119
120
120
- The fundamental way that Rusty Engine connects a user's game state to Bevy has been heavily
121
-
refactored to a new solution based on macros so that users can provide a custom struct with their
122
-
desired game state. This obseletes the old generic vectors and maps of various types that used to be
123
-
stored on the `GameState` struct (which itself has been renamed to `EngineState` to more accurately
124
-
describe what it is used for). Please refer to the [readme](./README.md) and
125
-
[docs](https://docs.rs/rusty_engine/latest/rusty_engine/) for comprehensive documentation on the new
126
-
approach.
121
+
refactored to a new solution based on macros so that users can provide a custom struct with their
122
+
desired game state. This obseletes the old generic vectors and maps of various types that used to be
123
+
stored on the `GameState` struct (which itself has been renamed to `EngineState` to more accurately
124
+
describe what it is used for). Please refer to the [readme](./README.md) and
125
+
[docs](https://docs.rs/rusty_engine/latest/rusty_engine/) for comprehensive documentation on the new
126
+
approach.
127
127
- Placing the module-level macro call `rusty_engine::init!(MyGameState)` is now required.
128
-
`MyGameState` is any user-defined struct type that will be passed to the logic functions each frame.
128
+
`MyGameState` is any user-defined struct type that will be passed to the logic functions each frame.
129
129
-`GameState` has been renamed to `EngineState` so that user's custom game state can be referred to
130
-
as `GameState` instead.
131
-
-`GameState::add_actor` has been renamed to `EngineState::add_sprite`
132
-
-`GameState::add_text_actor` has been renamed to `EngineState::add_text`
130
+
as `GameState` instead.
131
+
-`GameState::add_actor` has been renamed to `EngineState::add_one`
132
+
-`GameState::add_one_actor` has been renamed to `EngineState::add_one`
133
133
-`Game` now implements `Deref` and `DerefMut` for `EngineState`, so you can easily access
134
-
`EngineState`'s methods from `Game` in `main.rs` for your game setup. `Game::game_state_mut` has
135
-
been removed (if it had stayed it would have been renamed `engine_state_mut`, but with the deref
136
-
implementations it's not needed at all).
134
+
`EngineState`'s methods from `Game` in `main.rs` for your game setup. `Game::game_state_mut` has
135
+
been removed (if it had stayed it would have been renamed `engine_state_mut`, but with the deref
136
+
implementations it's not needed at all).
137
137
-`GameState.screen_dimensions`, which was set at startup and never updated, has been replaced by `EngineState.window_dimensions`, which is updated every frame so resizing the window can be handled in your game logic.
138
138
- Multiple logic functions can now be run. Pass them to `Game::run` in the order you would like them
139
-
run. Return `false` to abort running any later functions during the frame.
139
+
run. Return `false` to abort running any later functions during the frame.
140
140
- Logic functions now need to fit the signature `fn somename(engine_state: &mut EngineState, game_state: &mut GameState) -> bool`, where `GameState` is the user-defined struct passed to `rusty_engine::init!()`, or `()` if nothing was passed in.
141
141
-`.play_sfx()` now takes a volume level from `0.0` to `1.0` as a second argument, e.g. `.play_sfx(SfxPreset::Congratulations, 1.0)`
142
142
-`Actor` has been renamed to `Sprite` to eliminate the confusing "actor" terminalogy.
143
-
-`Actor::build` has been replaced by `Sprite::new`, which _must_ be used to create a `Sprite` instead of defining a struct literal (enforced via private phantom data). The `Default` implementation has been removed because of the previous restriction.
144
-
-`Actor.preset` has been removed
145
-
-`Actor.filename` (a `String`) has been replaced with `Sprite.filepath` (a `PathBuf`)
146
-
- The builder methods `Actor::set_collision` and `Actor::set_collider` have been removed since we never ended up adopting a builder pattern.
147
-
-`Sprite.collider_filepath` has been added
148
-
-`Sprite::write_collider` has been added (see note below about changes to colliders)
143
+
-`Actor::build` has been replaced by `Sprite::new`, which _must_ be used to create a `Sprite` instead of defining a struct literal (enforced via private phantom data). The `Default` implementation has been removed because of the previous restriction.
144
+
-`Actor.preset` has been removed
145
+
-`Actor.filename` (a `String`) has been replaced with `Sprite.filepath` (a `PathBuf`)
146
+
- The builder methods `Actor::set_collision` and `Actor::set_collider` have been removed since we never ended up adopting a builder pattern.
147
+
-`Sprite.collider_filepath` has been added
148
+
-`Sprite::write_collider` has been added (see note below about changes to colliders)
149
149
-`TextActor` has been renamed to `Text` to eliminate the confusing "actor" terminology.
150
-
-`TextActor.text` is now `Text.value` for similar reasons.
151
-
-`Sprite`s may now be created with either a `SpritePreset` or the path to an image file via both `Sprite::new` or `EngineState::add_sprite`. The image file needs to be stored in `assets/sprite` or one of its subdirectories. When specifying the path to the file, the path relative to `assets/sprite` should be used. For example, if your image is `assets/sprite/circus/animal.png` then you would pass `circus/animal.png` to one of the methods to create the sprite.
150
+
-`TextActor.text` is now `Text.value` for similar reasons.
151
+
-`Sprite`s may now be created with either a `SpritePreset` or the path to an image file via both `Sprite::new` or `EngineState::add_one`. The image file needs to be stored in `assets/sprite` or one of its subdirectories. When specifying the path to the file, the path relative to `assets/sprite` should be used. For example, if your image is `assets/sprite/circus/animal.png` then you would pass `circus/animal.png` to one of the methods to create the sprite.
152
152
-`SpritePreset::build_from_name` and `SpritePreset::build` have been removed (see note above about the new, more flexible way to create sprites)
153
153
-`SpritePreset::collider()` has been removed since colliders are no longer hard-coded features of presets (see note below about changes to colliders)
154
154
-`SpritePreset::filename -> String` has been replaced by `SpritePreset::filepath -> PathBuf`, which powers the `impl From<SpritePreset> for PathBuf` implementation.
155
-
- Colliders are now loaded from collider files. Collider files use the [Rusty Object Notation (RON)](https://github.com/ron-rs/ron) format. The easiest way to create a collider is to run the `collider_creator` example by cloning the `rusty_engine` repository and running `cargo run --release --example collider_creator relative/path/to/my/image.png`. The image needs to be somewhere inside the `assets/` directory. You could also create the collider programmatically, set it on the `Sprite` struct, and call the sprite's `write_collider()` method. Or you could copy an existing collider file, name it the same as your image file (but with the `.collider` extension) and change it to match your image. Collider coordinates need to define a convex polygon with points going in clockwise order. Coordinates are floating point values relative to the center of the image, with the center of the image being (0.0, 0.0).
155
+
- Colliders are now loaded from collider files. Collider files use the [Rusty Object Notation (RON)](https://github.com/ron-rs/ron) format. The easiest way to create a collider is to run the `collider_creator` example by cloning the `rusty_engine` repository and running `cargo run --release --example collider_creator relative/path/to/my/image.png`. The image needs to be somewhere inside the `assets/` directory. You could also create the collider programmatically, set it on the `Sprite` struct, and call the sprite's `write_collider()` method. Or you could copy an existing collider file, name it the same as your image file (but with the `.collider` extension) and change it to match your image. Collider coordinates need to define a convex polygon with points going in clockwise order. Coordinates are floating point values relative to the center of the image, with the center of the image being (0.0, 0.0).
156
156
- All sprites' colliders in the asset pack have been recreated more cleanly using the new `collider_creator` example.
157
157
- The `assets/fonts` directory in the asset pack has been renamed to `assets/font` for consistency with the other directories.
158
158
-`KeyboardState` and `MouseState` now both have 6 similar methods for processing key- and button-presses:
159
-
-`pressed` -> `pressed_any`
160
-
-`just_pressed` -> `just_pressed_any`
161
-
-`just_released` -> `just_released_any`
159
+
-`pressed` -> `pressed_any`
160
+
-`just_pressed` -> `just_pressed_any`
161
+
-`just_released` -> `just_released_any`
162
162
163
163
### Other Changes
164
164
165
165
-`AudioManager::music_playing()` will return whether or not music is currently playing (accessible
166
-
through `EngineState:audio_manager`)
166
+
through `EngineState:audio_manager`)
167
167
- A custom font may now be selected by placing it in `assets/font` and specifying the relative filepath on `Text.font`.
168
168
- Custom sounds may now be played via `AudioManager::play_music` and `AudioManager::play_sfx` by
169
-
specifying a path to a sound file relative to `assets/audio`.
169
+
specifying a path to a sound file relative to `assets/audio`.
170
170
-`Collider` now implements `PartialEq`, `Serialize`, and `Deserialize`
171
171
-`Collider::is_convex` was added to make it easier to tell if you have a convex collider.
172
-
- The `collider_creator` example was added to make it easy to load a sprite and make a collider file for it. Place your image file (let's call it `my_image.png`) anywhere inside your local clone of the Rusty Engine `assets/` directory and then run the example: `cargo run --release --example collider_creator -- assets/my_image.png`. Afterwards, copy the image file and the new collider file `my_image.collider` file over to the assets directory of your own project.
172
+
- The `collider_creator` example was added to make it easy to load a sprite and make a collider file for it. Place your image file (let's call it `my_image.png`) anywhere inside your local clone of the Rusty Engine `assets/` directory and then run the example: `cargo run --release --example collider_creator -- assets/my_image.png`. Afterwards, copy the image file and the new collider file `my_image.collider` file over to the assets directory of your own project.
173
173
- You can now toggle debug rendering of colliders by setting `EngineState.debug_sprite_colliders` to `true`. The `collision` example will now toggle that value when you press the `C` key.
174
174
- (meta) Improved CI times by using sccache together with GitHub Actions caching
175
175
- Circular colliders no longer have duplicate starting and ending coordinates
@@ -196,8 +196,8 @@ specifying a path to a sound file relative to `assets/audio`.
196
196
- Added `GameState.vec2_map` and `GameState.vec2_vec` as collections for the user to store state in.
197
197
- Switched all instances of `std::collections::HashMap` to `bevy::utils::HashMap`.
198
198
- Updated all examples to adjust for breaking changes, also:
199
-
- The `keyboard` example has been renamed to `keyboard_events` to distinguish it from the new `keyboard_state` example which uses `KeyboardState` for smooth movement
200
-
- The `mouse` example has been renamed to `mouse_events` to distinguish it from the new `mouse_state` example which uses `MouseState` for smooth movement
199
+
- The `keyboard` example has been renamed to `keyboard_events` to distinguish it from the new `keyboard_state` example which uses `KeyboardState` for smooth movement
200
+
- The `mouse` example has been renamed to `mouse_events` to distinguish it from the new `mouse_state` example which uses `MouseState` for smooth movement
201
201
- Added now `level_creator` example to use as a rudimentary level creator (originally added in 1.1.0)
202
202
203
203
## [1.1.4] - 2021-08-26
@@ -280,11 +280,13 @@ specifying a path to a sound file relative to `assets/audio`.
280
280
281
281
## 0.0.1 - [0.11.0]
282
282
283
-
- Rapid, messy development based on gfx via `glium`, sound via `rusty_audio`, timing via `rusty_time`, and custom logic for everything else. This approach never reached a very usable state.
283
+
- Rapid, messy development based on gfx via `glium`, sound via `rusty_audio`, timing via `rusty_time`, and custom logic for everything else. This approach never reached a very usable state.
Copy file name to clipboardExpand all lines: README.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,9 +47,11 @@ If you are using Linux or Windows Subsystem for Linux 2, please visit Bevy's [In
47
47
### You MUST download the assets separately!!!
48
48
49
49
Here are three different ways to download the assets (pick any of them--it should end up the same in the end):
50
+
50
51
- Clone the `rusty_engine` repository and copy/move the `assets/` directory over to your own project
51
52
- Download a [zip file](https://github.com/CleanCut/rusty_engine/archive/refs/heads/main.zip) or [tarball](https://github.com/CleanCut/rusty_engine/archive/refs/heads/main.tar.gz) of the `rusty_engine` repository, extract it, and copy/move the `assets/` directory over to your own project.
52
53
- (My favorite!) On a posix compatible shell, run this command inside your project directory:
54
+
53
55
```shell
54
56
curl -L https://github.com/CleanCut/rusty_engine/archive/refs/heads/main.tar.gz | tar -zxv --strip-components=1 rusty_engine-main/assets
55
57
```
@@ -76,7 +78,7 @@ Write your game!
76
78
// Create a game
77
79
letmutgame=Game::new();
78
80
// Set up your game. `Game` exposes all of the methods and fields of `Engine`.
Seealsothe [tutorial](https://cleancut.github.io/rusty_engine/), [game scenarios](https://github.com/CleanCut/rusty_engine/tree/main/scenarios), [code examples](https://github.com/CleanCut/rusty_engine/tree/main/examples) and the [API documentation](https://docs.rs/rusty_engine/latest/rusty_engine/)
114
115
115
116
## StudentShowcase
@@ -121,7 +122,7 @@ Show off the project you made with Rusty Engine! Learning Rust can be fun. 😄
121
122
122
123
## Contribution
123
124
124
-
All software contributions are assumed to be dual-licensed under MIT/Apache-2. All asset contributions must be under licenses compatible with the software license, and explain their license(s) in a `README.md` file in the same directory as the source files.
125
+
Allsoftwarecontributionsareassumedtobedual-licensedunderMIT/Apache-2.Allassetcontributionsmustbeunderlicensescompatiblewiththesoftwarelicense, andexplaintheirlicense(s) ina `README.md` fileinthesamedirectoryasthesourcefiles.
125
126
126
127
## AssetLicenses
127
128
@@ -135,11 +136,11 @@ Distributed under the terms of both the MIT license and the Apache License (Vers
135
136
136
137
See [license/APACHE](license/APACHE) and [license/MIT](license/MIT).
0 commit comments