melonJS icon indicating copy to clipboard operation
melonJS copied to clipboard

Change Body Class name

Open muyaszed opened this issue 2 years ago • 2 comments

Description of change

Change the Body class name to BodyObject

Please refer issue -> https://github.com/melonjs/melonJS/issues/1199

Merge Checklist
  • [x] Build process passed (npm run build)
  • [x] Lint process passed (npm run lint)
  • [x] Tests passed (npm run test)

muyaszed avatar Nov 02 '23 22:11 muyaszed

hi @muyaszed appreciating the pull request, but we cannot merge this, as It will break backward compatiliby and this "just" to fix a typing issue with TS.

is a proper way not to add proper typing for Body in a dedicated .ts file, that would then be added as a source directory when generating the .ts file(s) ?

something like :

declare class Body {
    constructor(ancestor: Renderable, shapes: Polygon, onBodyUpdate?: Function);

    ancestor: Renderable;
    bounds: Bounds;
    ...

    setStatic(isStatic?: boolean): this;
    addShape(shape:Polygon) : number;
   ...

}

obiot avatar Nov 03 '23 03:11 obiot

Yeah sure no problem this is just to start something which we could progress towards the better solution. I would take a look at the suggested code. Thanks for the reply

muyaszed avatar Nov 05 '23 14:11 muyaszed

closing this one, duplicate with #1199

obiot avatar Mar 25 '24 06:03 obiot