Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for Bacon2D API changes #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kenvandine
Copy link
Contributor

Updated to work with API changes in Bacon2D

sensor: true
onBeginContact: {
var body = other.getBody();
if (body.target.glassContact === true) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure to understand this modify. So, we take the body with getBody(), and this makes sense, but what is it target? And why is a property of body?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Body no longer inherits from QQuickItem, it now provides a property for target, which is the QQuickItem associated with the Body. In Bacon2D that is set to the Entity. It's very convenient in collisions, you don't have to hope other.parent is the Entity, you can rely on other.target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants