Fix heavy coins ignoring water physics (Closes #3729)#3771
Open
franciscogfsm wants to merge 1 commit intoSuperTux:masterfrom
Open
Fix heavy coins ignoring water physics (Closes #3729)#3771franciscogfsm wants to merge 1 commit intoSuperTux:masterfrom
franciscogfsm wants to merge 1 commit intoSuperTux:masterfrom
Conversation
Heavy coins (and coins dropped by killed enemies) were not applying water physics when falling into water, causing them to sink straight to the bottom at full speed instead of becoming floaty. Fixed by adding a per-frame water tile check in HeavyCoin::update(). When the coin is detected inside a water tile, the gravity modifier is reduced to 0.1 and the downward velocity is capped at 100, matching the floaty behaviour of other physics objects like rocks and enemies. Use named constants for water physics values Testing Implemented for the Bug Fix
Member
|
Hello, just curious which AI model you used for this? |
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
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.
Fix #3729: Heavy coins not affected by water physics
Heavy coins (and coins dropped by killed enemies) were not applying
water physics when falling into water, causing them to sink straight
to the bottom at full speed instead of floating like other objects.
Fixed by adding a per-frame water tile check in HeavyCoin::update().
When the coin is detected inside a water tile:
This matches the floaty behaviour of other physics objects such as
rocks and enemies. Named constants are used for both water physics
values to avoid magic numbers.
Tested manually by dropping heavy coins and enemy-dropped coins into
water both now float as expected. Automated tests have also been
implemented covering the fix.
Closes #3729