This repository has been archived by the owner on Oct 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Music and infrastructure for day-night cycle #102
Open
chrispetkau
wants to merge
10
commits into
amethyst:master
Choose a base branch
from
chrispetkau:day_night
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This allows the user to interact with the game while it is paused, which is desirable. - Correctly initialize and reset time scale changes in on_start and on_stop respectively so that exiting and re-entering MainGameState maintains program integrity. - Restored deletion of all organisms in MainGameState::on_stop(). This important line was deleted when it was last integrated. - Changed text color of ui buttons to have higher contrast.
…c in response. Hotkeys Alt-Y and Alt-N proxy the GoodMorning and GoodNight events respectively. Adjusted controls UI layout code and data to accommodate the new commands. Removed DjSystem and Audio resource as they have been supplanted by MusicSystem. Promoted ProgressCounter to a Resource to make it accessible by unrelated systems.
…. Changed hotkey for Morning to Alt-M. Re-wrote the code that creates a new sink using idiomatic, functional-style Rust.
I encountered several misleading things during this task:
Once I came to all these conclusions, the code more or less fell into place. I wrote a MusicSystem which adds audio::output::Output as a Resource and then creates AudioSinks as necessary to effect playback. And this bit of code is why I persist with Rust despite the ongoing borrow-checker battles and 5-minute compiles:
Terse, all errors considered and handled, not an if or extraneous indentation in sight! :D |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#76
Added events for GoodMorning and GoodNight, and hooked them up to hotkeys LAlt-M and LAlt-N respectively.
MusicSystem responds to DayNightCycleEvents by playing the appropriate music.