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

[Solved] Constructor of class 'b2World' is private and only accessible within the class declaration #25

Closed 8Observer8 closed 2 years ago

8Observer8 commented 2 years ago

Hi,

How to solve it?

image

Lusito commented 2 years ago

Hi,

the constructor is private in order to allow the extension libraries to work. Use b2World.Create(gravity) instead.

8Observer8 commented 2 years ago

Thank you very much!

const world = b2World.Create({ x: 0, y: 9.8 });