-
Notifications
You must be signed in to change notification settings - Fork 93
P2js: allow box collider to be at an angle #140
Conversation
|
Thanks for the pull request! I'm gonna review it right now! |
| shape: { type: "enum", items: [ "box", "circle" ], mutable: true }, | ||
| width: { type: "number", min: 0, mutable: true }, | ||
| height: { type: "number", min: 0, mutable: true }, | ||
| angle: { type: "number", min: -360, max: 360, mutable: true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we just go with -180 to 180? I guess that should be enough?
If yes, we should also fix here https://github.com/superpowers/superpowers-game/pull/140/files#diff-7066a6f42a064263978742ca1fe7f638R66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can change it if you want. I looked at Cannon Body and it uses -360;360 so I thought I would do the same. Let me know what you think is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay then I guess it's best to use what Cannon is using so let's keep it this way.
|
Done with the review! Seems to work fine so just a couple minor things to fix. Also I'm not sure what you meant by hardcode the x axis? |
| this.editConfig("setProperty", "height", parseFloat(event.target.value)); | ||
| }); | ||
|
|
||
| this.angleRow = SupClient.table.appendRow(this.tbody, SupClient.i18n.t("componentEditors:P2Body.angle")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I only added a translation for the english locale. Should I add a placeholder translation ("Angle"?) in the other locales to prevent it from showing as "componentEditors:P2Body.angle" in other languages? It kind of breaks the layout in the editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it should fallback to english automatically. Do you see it being shown as "componentEditors:P2Body.angle" somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that must have been before I added the english locale. Everything's alright then. Sorry.
|
I'm done with this branch unless you see something left to improve. |
|
Thanks for your contribution :) |
It's sometimes useful to have a box collider at an angle relative to the actor. While it would be possible to draw all the sprites perfectly horizontal and rotate the actor instead, I find this process very tedious. The picture bellow shows an example.
This is my first time contributing to superpowers. Please tell me if I should do anything different.
In particular, I'm very unsure about two things:
Thanks for your feedback.