Fix movement lines manual visibility issue#17
Merged
MakingSpiderSense merged 1 commit intoMay 13, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Refines the movement-speed-modifier component so speed lines only appear when the player is actually moving forward with an active boost, plus adds JSDoc and minor formatting cleanup.
Changes:
- New helpers
isMovingForward()andsyncSpeedLinesVisibility()factor out the logic for deciding whether speed lines should be shown (boost active + forward movement via keyboard, joystick, or arm-swing). applySpeedMultiplierandupdateSpeedLinesnow delegate tosyncSpeedLinesVisibility()instead of computing visibility inline; the early-return on visibility inupdateSpeedLineswas moved to after the interval check.- Removed the
keyboardEnabledearly-return fromonKeyDown(consistent withonKeyUp) and added blank-line spacing between methods.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
432
to
440
| updateSpeedLines: function (time, timeDelta) { | ||
| if (!this.lineContainer || !this.lineContainer.getAttribute("visible")) return; // Make sure line container is visible | ||
| this.timeSinceLastLinePattern += timeDelta; | ||
| if (this.timeSinceLastLinePattern < this.data.linePatternInterval) return; // Make sure enough time has passed | ||
| this.syncSpeedLinesVisibility(); | ||
| if (!this.lineContainer || !this.lineContainer.getAttribute("visible")) return; // Make sure line container is visible | ||
| // Reset time and randomize pattern | ||
| this.timeSinceLastLinePattern = 0; | ||
| this.randomizeSpeedLinePattern(); | ||
| }, |
Owner
Author
There was a problem hiding this comment.
This is totally fine. The linePatternInterval is meant to be a very short time, like 100 ms (the default). So that delay is barely perceptible.
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.
This pull request enhances the
movement-speed-modifiercomponent by improving code organization, adding detailed JSDoc comments, and introducing new utility methods to handle movement and visual feedback logic more robustly. The most notable functional change is the addition of logic to ensure speed lines are only shown when the player is moving forward with a speed boost, improving the user experience.https://trello.com/c/kbF3XV4C