Skip to content

Fix movement lines manual visibility issue#17

Merged
MakingSpiderSense merged 1 commit into
mainfrom
bugfix/movement-speed-modifier/110-movement-lines-manual-visibility-issue
May 13, 2026
Merged

Fix movement lines manual visibility issue#17
MakingSpiderSense merged 1 commit into
mainfrom
bugfix/movement-speed-modifier/110-movement-lines-manual-visibility-issue

Conversation

@MakingSpiderSense

Copy link
Copy Markdown
Owner

This pull request enhances the movement-speed-modifier component 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

Copilot AI review requested due to automatic review settings May 13, 2026 22:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() and syncSpeedLinesVisibility() factor out the logic for deciding whether speed lines should be shown (boost active + forward movement via keyboard, joystick, or arm-swing).
  • applySpeedMultiplier and updateSpeedLines now delegate to syncSpeedLinesVisibility() instead of computing visibility inline; the early-return on visibility in updateSpeedLines was moved to after the interval check.
  • Removed the keyboardEnabled early-return from onKeyDown (consistent with onKeyUp) 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();
},

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@MakingSpiderSense MakingSpiderSense merged commit 43236ea into main May 13, 2026
1 check passed
@MakingSpiderSense MakingSpiderSense deleted the bugfix/movement-speed-modifier/110-movement-lines-manual-visibility-issue branch May 13, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants