-
Notifications
You must be signed in to change notification settings - Fork 39
Misc. small fixes and adjustments #309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Daniel-Cortez
wants to merge
24
commits into
Techokami:Player-Refactor
Choose a base branch
from
Daniel-Cortez:misc-fixes
base: Player-Refactor
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.
Open
Misc. small fixes and adjustments #309
Daniel-Cortez
wants to merge
24
commits into
Techokami:Player-Refactor
from
Daniel-Cortez:misc-fixes
Conversation
This file contains hidden or 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
…s out of the loop
…instead of a combination of `min()`/`max()`
The X part remains zero anyway, so there's no need to multiply the whole vector.
`frame` is already an integer, so there's no reason to use `fmod()`.
…x using `range()`. When `range()` is used to specify a loop range, the loop is compiled into optimal bytecode that doesn't actually allocate an array or even call `range()`, so using that function should be zero-cost in such cases.
…hen the player is on ground and moving
…ts components separately
`Vector2` is not an object, so we don't need to call the constructor explicitly in order to create a copy.
…ng so twice for each of its components
… the colors of the blue ring sprite
…sistent with white and yellow in `hud_results_text.png`) Also fixed red and blue to be more consistent with Sonic's palette.
This also fixes a bug with the checkpoint time only being restored when respawning at the last checkpoint (for every other checkpoint the time was being reset to zero).
… code block, so it would be more obvious why exactly it won't work on player 2
It seems that I accidentally removed that line in 1a9d355, as it was inbetween the lines of the old code that played the 1-up jingle.
…y belongs to `_process()`, not `setState()`, so move it there Also, move `setState()` before the private functions (or "underscore-prefixed" functions, to be precise, as sadly there's no concept of private functions in GDScript), while we're at it.
…on doing in the "Players" group?
… theme (and vice versa) properly For example, when breaking an Invincibility monitor while the Speed Shoes theme is still playing, Level theme continued playing simultaneously with the Invincibility theme. Hopefully this is fixed now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR does the following:
For example, when breaking an Invincibility monitor while the Speed Shoes theme is still playing, Level theme continued playing simultaneously with the Invincibility theme.
Some of the calculations are moved out of the loop and the orbs are now updated only when the player is on ground and moving (there's no reason to update them all the time if their position haven't changed since the previous physics frame).
Player.gd.It seems that I accidentally removed the
Global.lives += 1line when implementingMusicController, as that line was "hidden" among the other lines of code that played the 1-up jingle.ShieldAnimations.gduse named constants for blend modes, instead of hardcoded IDs.