Releases: CleanCut/rusty_engine
Releases · CleanCut/rusty_engine
5.0.1
Improved
- Implemented all the common traits on public
structs andenums 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
boolto simplify the learning curve. If you want logic functions to run conditionally, instead track your state in yourGameStateand use it to exit early from your logic function. - The
EngineStatestruct andengine_statevariables have been renamed toEngineandengine, respectively, for brevity.
Full Changelog: v4.0.0...v5.0.0
4.0.0
BREAKING CHANGES
Gameis now generic over the user-provided game state struct, so theinit!macro from the short-lived3.0.0version has been removed! All you need to do is delete the macro call if you have it.EngineState.debug_sprite_collidershas been renamedEngineState.show_collidersfor clarity.- Renamed the
collider_creatorexample tocolliderfor brevity. - Added
Sprite.collider_dirtywhich you can set to true to regenerate a collider. Necessary if you manually replaceSprite.colliderwith a new collider.
Other Changes
- Upgraded to Bevy 0.6.
Textrotation and scale now works! 🎉- Switched to
bevy_prototype_lyonto 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 theGameStatestruct (which itself has been renamed toEngineStateto 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.
MyGameStateis any user-defined struct type that will be passed to the logic functions each frame. GameStatehas been renamed toEngineStateso that user's custom game state can be referred to
asGameStateinstead.GameState::add_actorhas been renamed toEngineState::add_spriteGameState::add_text_actorhas been renamed toEngineState::add_text
Gamenow implementsDerefandDerefMutforEngineState, so you can easily access
EngineState's methods fromGameinmain.rsfor your game setup.Game::game_state_muthas
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::runin the order you would like them
run. Returnfalseto 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, whereGameStateis the user-defined struct passed torusty_engine::init!(), or()if nothing was passed in. .play_sfx()now takes a volume level from0.0to1.0as a second argument, e.g..play_sfx(SfxPreset::Congratulations, 1.0)Actorhas been renamed toSpriteto eliminate the confusing "actor" terminalogy.Actor::buildhas been replaced bySprite::new, which must be used to create aSpriteinstead of defining a struct literal (enforced via private phantom data). TheDefaultimplementation has been removed because of the previous restriction.Actor.presethas been removedActor.filename(aString) has been replaced withSprite.filepath(aPathBuf)- The builder methods
Actor::set_collisionandActor::set_colliderhave been removed since we never ended up adopting a builder pattern. Sprite.collider_filepathhas been addedSprite::write_colliderhas been added (see note below about changes to colliders)
TextActorhas been renamed toTextto eliminate the confusing "actor" terminology.TextActor.textis nowText.valuefor similar reasons.
Sprites may now be created with either aSpritePresetor the path to an image file via bothSprite::neworEngineState::add_sprite. The image file needs to be stored inassets/spriteor one of its subdirectories. When specifying the path to the file, the path relative toassets/spriteshould be used. For example, if your image isassets/sprite/circus/animal.pngthen you would passcircus/animal.pngto one of the methods to create the sprite.SpritePreset::build_from_nameandSpritePreset::buildhave 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 -> Stringhas been replaced bySpritePreset::filepath -> PathBuf, which powers theimpl From<SpritePreset> for PathBufimplementation.- 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_creatorexample by cloning therusty_enginerepository 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 theSpritestruct, 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.colliderextension) 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_creatorexample. - The
assets/fontsdirectory in the asset pack has been renamed toassets/fontfor consistency with the other directories. KeyboardStateandMouseStatenow both have 6 similar methods for processing key- and button-presses:pressed->pressed_anyjust_pressed->just_pressed_anyjust_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/fontand specifying the relative filepath onText.font. - Custom sounds may now be played via
AudioManager::play_musicandAudioManager::play_sfxby
specifying a path to a sound file relative toassets/audio. Collidernow implementsPartialEq,Serialize, andDeserializeCollider::is_convexwas added to make it easier to tell if you have a convex collider.- The
collider_creatorexample 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.colliderfile over to the assets directory of your own project. - You can now toggle debug rendering of colliders by setting
EngineState.debug_sprite_colliderstotrue. Thecollisionexample will now toggle that value when you press theCkey. - (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_eventstoGameState.mouse_location_events - Renamed
Gamestate.delta_secondstoGameState.delta_f32 - Renamed
Gamestate.seconds_since_startuptoGameState.time_since_startup_f64
Other Changes
- Added
GameState::keyboard_state(and a newKeyboardStatestruct), 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 newMouseStatestruct), 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
MouseWheelStatestruct 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_mapandGameState.vec2_vecas collections for the user to store state in. - Switched all instances of
std::collections::HashMaptobevy::utils::HashMap. - Updated all examples to adjust for breaking changes, also:
- The
keyboardexample has been renamed tokeyboard_eventsto distinguish it from the newkeyboard_stateexample which usesKeyboardStatefor smooth movement - The
mouseexample has been renamed tomouse_eventsto distinguish it from the newmouse_stateexample which usesMouseStatefor smooth movement
- The
- Added now
level_creatorexample to use as a rudimentary level creator (originally added in 1.1.0)
Full Changelog: v1.1.4...v2.0.0