Skip to content

🚀 Feature: Allow angle-directed physics gravity #1522

Description

@JoshuaKGoldberg

Feature Request Checklist

Overview

Right now, physics.gravity is a number:

gravity (_0.35`_): How much to increase y-velocity downward each tick.

That allows users to specify different vertical amounts. That includes negative gravities such as in the Inverse Gravity demo.

But, what if users want to rotate gravity at an arbitrary angle? Say, make it horizontal (90 degrees) or directly diagonal (45 degrees)? There's no clean way to do that right now.

Proposal: how about allowing gravity to alternately be an object containing:

  • acceleration: what the number currently represents, with the same 0.35 default
  • angle: a number in [0, 360), currently defaulting to 180 (down)

Additional Info

This would not be a breaking change as proposed. The default should still be number with the current angle.

🎆

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: accepting prsPlease, send a pull request to resolve this! 🙏type: featureNew enhancement or request 🚀

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions