diff --git a/content/06_libraries.html b/content/06_libraries.html index 4102a61..63e85b9 100644 --- a/content/06_libraries.html +++ b/content/06_libraries.html @@ -79,7 +79,7 @@

draw()

  1. Calculate all the forces in the world.
  2. -
  3. Apply all the forces to the objects (F = M * A).
  4. +
  5. Apply all the forces to the objects (F = M \times A).
  6. Update the positions of all the objects based on their acceleration.
  7. Draw all the objects.
@@ -94,9 +94,14 @@

This, of course, is the allure of a physics engine. I’ve eliminated all those painful steps of figuring out how the objects are moving according to velocity and acceleration. Matter.js is going to take care of this for me!

While there will be more details to reveal, the good news is that the simplicity of this pseudocode is an accurate reflection of the overall process. In this sense, Matter.js is a bit like a magic box. In setup(), I’m going to say to Matter, “Hello there. Here are all of the things I want in my world.” Then, in draw(), I’m going to politely ask Matter, “Oh, hello again. If it’s not too much trouble, I’d like to draw all of those things in my world. Could you please tell me where they are?”

-

The bad news: the process is not quite as simple as the pseudocode might lead you to believe. Actually making the stuff that goes into the Matter.js world requires several steps related to building and configuring different kinds of shapes. It’s also necessary to learn to speak the language of Matter.js in terms of how the various forces and other parameters of the world are configured. Here are the core concepts:

+

The bad news: the process is not quite as simple as the pseudocode might lead you to believe. Actually making the stuff that goes into the Matter.js world requires several steps related to building and configuring different kinds of shapes.

+
+

It’s also necessary to learn to speak the language of Matter.js in terms of how the various forces and other parameters of the world are configured. Here are the core concepts:

+ +