flyover / box2d.ts

A TypeScript port of Box2D
https://flyover.github.io/box2d.ts/testbed
MIT License
406 stars 85 forks source link

Do you have a plane to Change the name of API ? #7

Open finscn opened 6 years ago

finscn commented 6 years ago

@flyover , Hi , Do you have a plane to Change the name of API , then provide a JavaScript-friendly API ?

example: box2d.b2BodyDef --> Box2d.bodyDef world.CreateBody --> world.createBody b2BodyType.b2_dynamicBody --> bodyType.dynamicBody ...

the things https://github.com/shakiba/planck.js do :

Nick-Riggs commented 6 years ago

This lib is looking awesome and it's performance is very good.

👍 I would also like to see the naming conventions more along the lines of ECMAScript standards.

Nek- commented 6 years ago

Why?

On my side, I'm in favor of using Box2D standards. To improve code portability.

alpertuna commented 6 years ago

I also don't like the Box2D API naming BUT to benefit Box2D manual and tuts on internet, changing API may not be a good idea. Instead I have some wrapper classes on my project to use Box2D easily. Btw thanks @flyover ! for preparing this ts version, so that I can find my way using autocompletions.

flyover commented 4 years ago

Yeah, I think I'm going to leave it as close to the original API as possible. Perhaps a wrapper that added some of these JS features would be nice, especially if the underlying physics engine could be swapped out.