melonjs / melonJS

a fresh, modern & lightweight HTML5 game engine
https://melonjs.org
MIT License
5.88k stars 646 forks source link

Change Body Class name #1208

Closed muyaszed closed 6 months ago

muyaszed commented 11 months ago
Description of change

Change the Body class name to BodyObject

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

Merge Checklist
obiot commented 11 months ago

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;
   ...

}
muyaszed commented 11 months ago

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

obiot commented 6 months ago

closing this one, duplicate with #1199