Skip to content
This repository was archived by the owner on Mar 5, 2021. It is now read-only.

Conversation

@Ikalou
Copy link
Contributor

@Ikalou Ikalou commented Aug 31, 2016

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.

ps_box_angle

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:

  • Is the migration bit in P2BodyConfig alright? I'm not too sure how it works.
  • Is it ok to hardcode the z axis the way I did?

Thanks for your feedback.

@bilou84
Copy link
Contributor

bilou84 commented Sep 3, 2016

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 },
Copy link
Contributor

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

Copy link
Contributor Author

@Ikalou Ikalou Sep 3, 2016

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.

Copy link
Contributor

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.

@bilou84
Copy link
Contributor

bilou84 commented Sep 3, 2016

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"));
Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@Ikalou
Copy link
Contributor Author

Ikalou commented Sep 3, 2016

I'm done with this branch unless you see something left to improve.

@bilou84 bilou84 merged commit 0ee4dbb into superpowers:master Sep 3, 2016
@bilou84
Copy link
Contributor

bilou84 commented Sep 3, 2016

Thanks for your contribution :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants