Skip to content

Conversation

Geokureli
Copy link
Member

@Geokureli Geokureli commented Apr 16, 2024

Attempt number 2 at #2704:

Allow linear drag and max speed

Meaning it's calculated based on velocity's magnitude rather than the individual x/y speed. New fields: dragMode and maxSpeedMode

Examples

// old code
// drag.x = drag.y = 800;
// maxVelocity.x = maxVelocity.y = SPEED; // possible to go SPEED * sqrt(2)

// new code
dragMode = XY(800, 800); // behaves identical to old code
maxSpeedMode = LINEAR(SPEED); // impossible to go faster than SPEED

Drag on skid

New field dragApplyMode:
INERTIAL - old behavior where drag is applied when acceleration is 0
ALWAYS - drag is always applied
SKID - drag is applied when inertial or decelerating

TO DO

  • Docs
  • Unit tests
  • Allow different drag modes for X/Y (important for platformers) this might kill this feature if I don't do this right
  • Remove deprecation warnings (only added them to remove refs in other flixel tools)

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.

1 participant