You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.
While doing the platformer tutorial I discovered that the collision shape was aligning itself with the left edge of the renderable shape, instead of centered. The tutorial implies that centering will be done automatically around the origin, and shows a picture that appears to indicate this. The only other reference to the collision shape/size is that it can be adjusted in Tiled (which functions).
I corrected this by adding this.renderable.translate(-16, 0); to my init function for the PlayerEntity. I'm uncertain if is the best approach, and I'm not certain if this is a bug with melonJS, or just undocumented behavior that should be added to the tutorial.
Without the offset:
With the offset:
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
While doing the platformer tutorial I discovered that the collision shape was aligning itself with the left edge of the renderable shape, instead of centered. The tutorial implies that centering will be done automatically around the origin, and shows a picture that appears to indicate this. The only other reference to the collision shape/size is that it can be adjusted in Tiled (which functions).
I corrected this by adding
this.renderable.translate(-16, 0);
to myinit
function for thePlayerEntity
. I'm uncertain if is the best approach, and I'm not certain if this is a bug with melonJS, or just undocumented behavior that should be added to the tutorial.Without the offset:
With the offset:
The text was updated successfully, but these errors were encountered: