CRITICAL: Double gravity applied to player ship each frame #3
Labels
No labels
blocked:needs-decision
blocked:no-changes
feature-request
quickfix
test-coverage
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/gravity-racer#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Both
Ship.update()andPhysicsEngine.update()apply gravitational forces to the player ship each frame, resulting in double gravity.Root cause
In
main.js:this.playerShip.update(dt, wells, sl)-- Ship.update() lines 115-124 apply gravity from wells to velocitythis.physics?.update(this.playerShip, ...)-- PhysicsEngine.update() lines 222-227 ALSO apply gravity from wells to velocityImpact
Ships experience approximately 2x expected gravitational pull, making orbits unstable and gameplay feel wrong.
Fix
Remove gravity integration from one of the two methods. Ship.update() should handle ship-internal physics (thrust, RCS, resources) while PhysicsEngine.update() handles external forces (gravity, collisions). Or vice-versa.