1

I've been wanting to code a spring in python using pygame but I don't quite know how to implement F = -kx into circles that actually move around.

I've tried adding the force to dx and dy and adding that to the lower circle's pos and I've also tried just setting the position of the lower circle to the force. None of these work and I'm just extremely confused I want to hard code the physics instead of using a physics engine like pymunk.

SoulDaMeep
  • 57
  • 6
  • 1
    Have you looked at [tag:pymunk]? Maybe [this question](https://stackoverflow.com/q/64319811/2280890) will help you. – import random Oct 31 '22 at 14:12
  • @importrandom i have looked at pymunk in the past but i want to program my own physics of a spring – SoulDaMeep Nov 29 '22 at 19:46
  • If you're creating your own spring physics from scratch, and are encountering difficulties, you should create a new question with a [mre]. If you're struggling more conceptually, asking on [GameDev](https://gamedev.stackexchange.com/) would be better. – import random Nov 29 '22 at 23:26

0 Answers0