Lusito / box2d.ts

Full blown Box2D Ecosystem for the web, written in TypeScript
https://lusito.github.io/box2d.ts
60 stars 6 forks source link

Potential Project Dependant - How to install and Good Fit? #21

Closed Dondelium closed 2 years ago

Dondelium commented 2 years ago

Hey, I didn't see a contact link, so I am adding a not-issue.

I am actively working on an IO game that I am building and I have two question I need answered.

  1. How would I add Box2d as a dependency for an Angular project?
  2. Would Box2D be a good fit for my project?

Projects general premise is: 2D Spaceship combat simulation-lite with planets, gravity, ships etc etc. Main physics needed: raycasts, impulse, newtonian physics, box collision.

Lusito commented 2 years ago

Hi @Dondelium,

  1. You would add it like any other dependency. For example npm i @box2d/core for the core library.
  2. Box2d only has one directional vector for gravity. So if you plan on having gravity towards a center, you'll have to implement that attraction yourself. Aside from that, you should be fine.

Take a look at the test-bed: https://lusito.github.io/box2d.ts/testbed/