The slopes variable added to the Body class is a dynamic object. These are unusable in typescript as they will throw errors when trying to access their member variables(unless you use ['array'] access). This commit I created some classes in the typescript definition so that the variables are properly accessible: IkonOne@df06dc6
The added classes are BodySlopes and BodySlopesSat. I think that an approach like this is ok for now. If you agree with this approach, I can convert the objects in the JS code to classes as well as you mentioned the possibility of here: https://github.com/hexus/phaser-arcade-slopes/blob/master/src/ArcadeSlopes/Facade.js#L87
The two classes needed could possibly go in a new file called BodyMods.js or something.
Also, since the sat variable is only used to store the responses, maybe simply having a collision or response variable might be a better fit.
The slopes variable added to the Body class is a dynamic object. These are unusable in typescript as they will throw errors when trying to access their member variables(unless you use ['array'] access). This commit I created some classes in the typescript definition so that the variables are properly accessible: IkonOne@df06dc6
The added classes are
BodySlopesandBodySlopesSat. I think that an approach like this is ok for now. If you agree with this approach, I can convert the objects in the JS code to classes as well as you mentioned the possibility of here: https://github.com/hexus/phaser-arcade-slopes/blob/master/src/ArcadeSlopes/Facade.js#L87The two classes needed could possibly go in a new file called BodyMods.js or something.
Also, since the
satvariable is only used to store the responses, maybe simply having acollisionorresponsevariable might be a better fit.