Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » 2d physics?

This thread is locked; no one can reply to it. rss feed Print
2d physics?
blargmob
Member #8,356
February 2007
avatar

Howdy,

Does anyone know of any 2d Phyics libraries that I could use?
???

---
"No amount of prayer would have produced the computers you use to spread your nonsense." Arthur Kalliokoski

deps
Member #3,858
September 2003
avatar

I once downloaded Tokamak and found a piece of code on their forum that restricted it to not use the Z axis. But there's ways to make things like that in Ode and Newton too.

---
Layers are good, all good things have layers, like onions. Good things also stink. - Trezker
I now have a page and a blog!

relay01
Member #6,988
March 2006
avatar

Quote:

Does anyone know of any 2d Phyics libraries that I could use?

Open up your physics book and be a real programmer like everyone else avoids doing.

just remember F = ma; g = 9.8 m/s^2; just as long as your pixels are to scale with meters... you'll be all set ;)

More seriously though... These days the biggest challenge in game programming is making things behave like they do in real life. So putting it in a 2-d sense shouldn't be too hard, most of the rules for things like "how fast does something fall if shot at this angle and this initial velocity" and "if i scoot this thing on the floor and the floor has a friction value, how long or far will it get" are now formula based.

I suppose this would take time, which is why most indie programmers like to avoid it. It all depends on how inspired you feel.

_____________________________________

Jonny Cook
Member #4,055
November 2003

Quote:

Open up your physics book and be a real programmer like everyone else avoids doing.

Well, I believe being a "real programmer" involves not reinventing the wheel. If a physics library already exists out there, he might as well use it. His time is better spent solving things that haven't already been solved.

Now, if I could only follow my own advice, maybe I would have actually finished a game by now. :P

The face of a child can say it all, especially the mouth part of the face.

X-G
Member #856
December 2000
avatar

JFGI.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Ceagon Xylas
Member #5,495
February 2005
avatar

Quote:

just remember F = ma; g = 9.8 m/s^2; just as long as your pixels are to scale with meters... you'll be all set ;)

That's assuming you want realistic physics. Hardly any 2d games use extremely strict physics simulations. Things tend to look bouncier, seem larger-than-life, and have much less gravity than on earth. But if it's what you want, definitely follow the rules.

Slartibartfast
Member #8,789
June 2007
avatar

Quote:

just remember F = ma; g = 9.8 m/s^2; just as long as your pixels are to scale with meters... you'll be all set ;)
That's assuming you want realistic physics. Hardly any 2d games use extremely strict physics simulations. Things tend to look bouncier, seem larger-than-life, and have much less gravity than on earth. But if it's what you want, definitely follow the rules.

That would usually only require changing constants (like g or various k's and μ's) on top of the "real world" physics.
Of course, completely made up physics can also be quite fun from time to time.

blargmob
Member #8,356
February 2007
avatar

Thanks, but I think I'll just stick with writing my own routines... ;)

---
"No amount of prayer would have produced the computers you use to spread your nonsense." Arthur Kalliokoski

Go to: