Is anyone using "box2d" or other "physics engines"?

.
Is anyone using “box2d” or other “physics engines”?
.
I plan to learn “box2d” or other “physics engines”. I am a beginner with no experience and don’t even know how to start. Can someone guide me? I am seeking help
.

For example, I have two ‘moveclip’
How to use the ‘Physics Engine’?

Nape is another popular physics engine. Here’s the manual:

And samples:

1 Like

How did this go? → Is there a Box2D tutorial available for beginners to learn?

1 Like

.
I have seen this before,
Is there any way to associate the ‘physics engine’ with my ‘moveclip’?
I don’t know how to start yet?
.
Can someone provide the code?
.

This will help you:

Note how the physics objects contain a reference to the displayObject (can be a MovieClip) using the userData variable. Then as the update function runs, it updates the displayObject by finding it using getUserData();

Okay, okay, thank you very much.
Does everyone prefer to use ‘nape’?

I’ve not used either, as for my purposes, I’ve always just programmed my own physics.

But, if you’re after some metrics:

Box2D

  • 102 GitHub :star: since Jan 18 2012.*
  • 13 contributors.
  • Most recent commit Jan 3 2025.
  • Commits last 2 years: 12
  • Commits last year: 1

Nape

  • 544 GitHub :star: since Jul 22 2011.
  • 5 contributors.
  • Most recent commit Aug 15 2016.
  • Commits last 2 years: 0
  • Commits last year: 0

If I was to consider a physics engine with these two options, from a pragmatic perspective, I’d be looking at Box2D first. Primarily because it is more actively maintained, and many folk who maintain it, are here in the OpenFL community.

Just a casual question, because in this post “jostynjala” recommended “nape” to me, “box2d” seems to have been updated more actively

I suspect (and @joshtynjala may correct me if I’ve mishandled this), he was simply putting another popular option on the table for you to consider.

Box2D and Nape are the two main physics engines. There are some others, but they’ve not been updated in many years, so I’m hesitant to mention them.

Okay, I understand. Thank you.

In earlier days, I used Box2D a lot. Then I figured out, that Nape is much faster and memory-efficient. But I don’t know if this is still a thing today. It would be interesting to hear about current experiences!

I haven’t used the physics engine yet,
Can you teach me how to use ‘Nape’?

Mainly, I don’t know how to create a physical world and how to make my display objects (game character animations) have physical effects. I haven’t been exposed to physics engines and I don’t understand this process.

The very short version is that you first create the physics world or space and define gravity as a vector. Then you have to assign a physics body to all objects, which can be of the type static, kinematic, or dynamic. In the loop/render function of your game, you then have to call the step function of the physics engine.
Here is a good introduction:
Nape Manual
Box2D Manual
Box2D old Flash Version
When I was working with Flash on a daily basis, Emanuele Feronato’s website was a great help to me. Here you will also find many useful AS3 + Box2D tutorials.
Although Nape and Box2D differ in some respects, the core principle of physics engines is always similar, so you will find a lot of useful information here:
Emanuele Feronato, old Box2D + Flash Examples

All Nape samples ( Nape Physics ) have haxe and as3 sources : just click the small play button on a sample, then select .as3 or .hx in the window