Releases: CleanCut/rusty_engine
Releases · CleanCut/rusty_engine
5.0.1
Improved
- Implemented all the common traits on public
struct
s andenum
s that made sense. - Added documentation for a few structs, enums, and methods that were missing it.
Full Changelog: v5.0.0...v5.0.1
5.0.0
BREAKING CHANGES
- Logic functions no longer return a
bool
to simplify the learning curve. If you want logic functions to run conditionally, instead track your state in yourGameState
and use it to exit early from your logic function. - The
EngineState
struct andengine_state
variables have been renamed toEngine
andengine
, respectively, for brevity.
Full Changelog: v4.0.0...v5.0.0
4.0.0
BREAKING CHANGES
Game
is now generic over the user-provided game state struct, so theinit!
macro from the short-lived3.0.0
version has been removed! All you need to do is delete the macro call if you have it.EngineState.debug_sprite_colliders
has been renamedEngineState.show_colliders
for clarity.- Renamed the
collider_creator
example tocollider
for brevity. - Added
Sprite.collider_dirty
which you can set to true to regenerate a collider. Necessary if you manually replaceSprite.collider
with a new collider.
Other Changes
- Upgraded to Bevy 0.6.
Text
rotation and scale now works! 🎉- Switched to
bevy_prototype_lyon
to power the debug lines. They look much nicer now that I can choose the line thickness. - Updated (or finished) all of the game scenario descriptions.
- Updated the tutorial.
New Contributors
Full Changelog: v3.0.0...v4.0.0
3.0.0
BREAKING CHANGES
- The fundamental way that Rusty Engine connects a user's game state to Bevy has been heavily
refactored to a new solution based on macros so that users can provide a custom struct with their
desired game state. This obseletes the old generic vectors and maps of various types that used to be
stored on theGameState
struct (which itself has been renamed toEngineState
to more accurately
describe what it is used for). Please refer to the readme and
docs for comprehensive documentation on the new
approach. - Placing the module-level macro call
rusty_engine::init!(MyGameState)
is now required.
MyGameState
is any user-defined struct type that will be passed to the logic functions each frame. GameState
has been renamed toEngineState
so that user's custom game state can be referred to
asGameState
instead.GameState::add_actor
has been renamed toEngineState::add_sprite
GameState::add_text_actor
has been renamed toEngineState::add_text
Game
now implementsDeref
andDerefMut
forEngineState
, so you can easily access
EngineState
's methods fromGame
inmain.rs
for your game setup.Game::game_state_mut
has
been removed (if it had stayed it would have been renamedengine_state_mut
, but with the deref
implementations it's not needed at all).GameState.screen_dimensions
, which was set at startup and never updated, has been replaced byEngineState.window_dimensions
, which is updated every frame so resizing the window can be handled in your game logic.- Multiple logic functions can now be run. Pass them to
Game::run
in the order you would like them
run. Returnfalse
to abort running any later functions during the frame. - Logic functions now need to fit the signature
fn somename(engine_state: &mut EngineState, game_state: &mut GameState) -> bool
, whereGameState
is the user-defined struct passed torusty_engine::init!()
, or()
if nothing was passed in. .play_sfx()
now takes a volume level from0.0
to1.0
as a second argument, e.g..play_sfx(SfxPreset::Congratulations, 1.0)
Actor
has been renamed toSprite
to eliminate the confusing "actor" terminalogy.Actor::build
has been replaced bySprite::new
, which must be used to create aSprite
instead of defining a struct literal (enforced via private phantom data). TheDefault
implementation has been removed because of the previous restriction.Actor.preset
has been removedActor.filename
(aString
) has been replaced withSprite.filepath
(aPathBuf
)- The builder methods
Actor::set_collision
andActor::set_collider
have been removed since we never ended up adopting a builder pattern. Sprite.collider_filepath
has been addedSprite::write_collider
has been added (see note below about changes to colliders)
TextActor
has been renamed toText
to eliminate the confusing "actor" terminology.TextActor.text
is nowText.value
for similar reasons.
Sprite
s may now be created with either aSpritePreset
or the path to an image file via bothSprite::new
orEngineState::add_sprite
. The image file needs to be stored inassets/sprite
or one of its subdirectories. When specifying the path to the file, the path relative toassets/sprite
should be used. For example, if your image isassets/sprite/circus/animal.png
then you would passcircus/animal.png
to one of the methods to create the sprite.SpritePreset::build_from_name
andSpritePreset::build
have been removed (see note above about the new, more flexible way to create sprites)SpritePreset::collider()
has been removed since colliders are no longer hard-coded features of presets (see note below about changes to colliders)SpritePreset::filename -> String
has been replaced bySpritePreset::filepath -> PathBuf
, which powers theimpl From<SpritePreset> for PathBuf
implementation.- Colliders are now loaded from collider files. Collider files use the Rusty Object Notation (RON) format. The easiest way to create a collider is to run the
collider_creator
example by cloning therusty_engine
repository and runningcargo run --release --example collider_creator relative/path/to/my/image.png
. The image needs to be somewhere inside theassets/
directory. You could also create the collider programmatically, set it on theSprite
struct, and call the sprite'swrite_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). - All sprites' colliders in the asset pack have been recreated more cleanly using the new
collider_creator
example. - The
assets/fonts
directory in the asset pack has been renamed toassets/font
for consistency with the other directories. KeyboardState
andMouseState
now both have 6 similar methods for processing key- and button-presses:pressed
->pressed_any
just_pressed
->just_pressed_any
just_released
->just_released_any
Other Changes
AudioManager::music_playing()
will return whether or not music is currently playing (accessible
throughEngineState:audio_manager
)- A custom font may now be selected by placing it in
assets/font
and specifying the relative filepath onText.font
. - Custom sounds may now be played via
AudioManager::play_music
andAudioManager::play_sfx
by
specifying a path to a sound file relative toassets/audio
. Collider
now implementsPartialEq
,Serialize
, andDeserialize
Collider::is_convex
was added to make it easier to tell if you have a convex collider.- 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 itmy_image.png
) anywhere inside your local clone of the Rusty Engineassets/
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 filemy_image.collider
file over to the assets directory of your own project. - You can now toggle debug rendering of colliders by setting
EngineState.debug_sprite_colliders
totrue
. Thecollision
example will now toggle that value when you press theC
key. - (meta) Improved CI times by using sccache together with GitHub Actions caching
- Circular colliders no longer have duplicate starting and ending coordinates
New Contributors
- @Dajamante made their first contribution in #14
Full Changelog: v2.0.1...v3.0.0
2.0.1
2.0.0
BREAKING CHANGES
- Renamed
GameState.cursor_moved_events
toGameState.mouse_location_events
- Renamed
Gamestate.delta_seconds
toGameState.delta_f32
- Renamed
Gamestate.seconds_since_startup
toGameState.time_since_startup_f64
Other Changes
- Added
GameState::keyboard_state
(and a newKeyboardState
struct), to determine the current state of the keyboard. This should be preferred over keyboard events when dealing with character movement, etc. - Added
GameState::mouse_state
(and a newMouseState
struct), to determine the current state of the mouse. In most cases, this should be preferred over mouse methods when dealing with character movement, etc. - Added a new
MouseWheelState
struct to represent the state of the mouse wheel, which is a simplified representation of cumuluative mouse wheel events. - Added an "Extreme Driver's Ed" scenario reference implementation (
cargo run --release --example extreme_drivers_ed
). - Documented
GameState
- Added
GameState.vec2_map
andGameState.vec2_vec
as collections for the user to store state in. - Switched all instances of
std::collections::HashMap
tobevy::utils::HashMap
. - Updated all examples to adjust for breaking changes, also:
- The
keyboard
example has been renamed tokeyboard_events
to distinguish it from the newkeyboard_state
example which usesKeyboardState
for smooth movement - The
mouse
example has been renamed tomouse_events
to distinguish it from the newmouse_state
example which usesMouseState
for smooth movement
- The
- Added now
level_creator
example to use as a rudimentary level creator (originally added in 1.1.0)
Full Changelog: v1.1.4...v2.0.0