Ask coding questions

← Back to all posts
Best Physics Coding Language

Hello! I am going to make a game with a bit of physics in it, and was wondering what would be the best language/template to do that in. I would prefer a language that I already know, even if it isn't the easiest, but am totally willing to learn a new one if it is ridiculously easier. The ones I do know are: java, c#, and js/html/css.

For the record, I am not asking for something that does everything for me (but if it does...). I just want a language that is moderately easy to organise and can handle graphics well.

Here is what I am trying to do, it would be helpful if the one that you suggest can do any or all of these:

  • Ships that can fly around the screen
  • collision detection
  • particles
  • orbits
  • bullets
  • classes
  • handles lots of objects

Note: please don't mention java swing. I looked into this and it isn't one I would like to do.

Thanks for at least reading this!

If i decide your answer is the one I was looking for, I WILL mark it, but probably not right away. DON'T SPAM ME

Answered by elipie [earned 5 cycles]
View Answer

I would use 3js(for 3d games) or p5.js for anything really. DONT DO C#


Would this be for


@GeneralBaker yes, you can use p5.js and three js on replit.


I am going to go with this answer. Thank you for your suggestion! @elipie


c# is a good language, since it uses Unity, but you might want to consider c, or c++, they use buildengine, which is better than Unity.


no. dont use C#, C# sucks without unity. The only reason it is still up and is a known lang, is cuz unity. Do not ever suggest C# @RYANTADIPARTHI


Check out python's pygame module. Python is good for math (which is good for physics) and pygame can do everything you stated.


hmm... I will take a look at this later today. @RhinoRunner


Hmmm, I think what you could do (especially for multiplayer) is make the webpage act as an i/o board, and handle all the physics server-side. If you really want to get into it (and waste some time), you could do the physics in C++, which would ensure really fast speeds. If you don't want it to be that complex, you could do Golang or Rust (which are both really fast and efficient). Might I also remind you that physics are really hard and would often require a major in physics to even understand (I tried gravity in a minecraft remake with me and tussiez and it failed epically. (Might just have been how we calculated the distance though)). But, you seem like you've thought this through so best of luck to you.

If you don't want a server-side language, threejs is a good idea (or WebGL if you're up for the geometry knowledge needed).


I would say C# is the right language for this. You can code with Unity, a Game Engine. I don't know much about game development but I think Unity has a physic's engine!


yeah, i think unity will be good @Squirrel777


no. dont use C#, C# sucks without unity. The only reason it is still up and is a known lang, is cuz unity. Do not ever suggest C#


oh. ok @elipie