Magic Pen
Games and ApplicationsAwesome game, even if it is a clone of Crayon Physics.
Yeah, he uses Box2D, and he thanks Erin and Matt in the credits.
Yeah, he uses Box2D, and he thanks Erin and Matt in the credits.
I did what I could. Compared to Petri I´m quite incompetent as a programmer.
That explains why there´s no support for concave shapes...
Crayon Physics Deluxe is going to be ten times better, no question about that.
Actually I started with an approach similar to HatsForMyPencil, by making lines out of little rectangles, but having played Phun recently I wanted to add hinges. So I just ended using a convex hull algorithm to create the polygons.
That explains why there´s no support for concave shapes...
Crayon Physics Deluxe is going to be ten times better, no question about that.
Actually I started with an approach similar to HatsForMyPencil, by making lines out of little rectangles, but having played Phun recently I wanted to add hinges. So I just ended using a convex hull algorithm to create the polygons.
A friend just linked me to this.
Nice work alegui! and thanks for including me in the credits.
-Matt
Nice work alegui! and thanks for including me in the credits.
-Matt
For the people interested in using Box2D in Flash, I guess most of you already know this, but for those who dont:
I suggest making a couple of classes to be able to edit levels just by dragging stuff to the screen. Just extend MovieClip and make some components, it is very useful.
For example, I made a "World" component, with the code to create a box2D world.
Inside the "World" you can drag "Body" components, which instantiate box2D bodies,
and inside a "Body" component you can drag "Shape" components, to make bodies with several shapes, etc... Then the components can have parameters to tweak the common variables, like gravity and timestep for the world, density, friction... for the bodies, etc...
It´s very easy to do.
I suggest making a couple of classes to be able to edit levels just by dragging stuff to the screen. Just extend MovieClip and make some components, it is very useful.
For example, I made a "World" component, with the code to create a box2D world.
Inside the "World" you can drag "Body" components, which instantiate box2D bodies,
and inside a "Body" component you can drag "Shape" components, to make bodies with several shapes, etc... Then the components can have parameters to tweak the common variables, like gravity and timestep for the world, density, friction... for the bodies, etc...
It´s very easy to do.
Is there any really good references on making components? I basically did what you did, but I just used regular MCs and classes, didn't try using components. From my understanding, aren't components just classes attached to MCs in which you can change variables in the properties tab?
warhell wrote:
From my understanding, aren't components just classes attached to MCs in which you can change variables in the properties tab?
That's pretty much 100% dead on. Except I would word it, "classes attached to library symbols." I posted this a long time ago as a demonstration: viewtopic.php?f=8&t=367
alegui wrote:
I did what I could. Compared to Petri I´m quite incompetent as a programmer.
That explains why there´s no support for concave shapes...
That explains why there´s no support for concave shapes...
Very nice!!
If you want to try concave shapes, try using this class: http://www.box2d.org/forum/viewtopic.php?f=6&t=874 (I posted the code somewhere below)
Original thread: https://box2d.org/forum/viewtopic.php?t=661