-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Allow the character to flip in both directions #11347
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
base: master
Are you sure you want to change the base?
Conversation
Problem: the character when moving down with angle the sprite was looking up not down so i seperated the code responsible of the flipping
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.
The C# code needs to be changed to match as well
Removed unnecessary comments in GDScript code.
Co-authored-by: A Thousand Ships <[email protected]>
This also needs to be changed in the demo project as they should match |
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.
LGTM now, with some minor details
But would need a matching PR on the demo projects to keep these synced
if (velocity.X != 0) | ||
{ | ||
animatedSprite2D.Animation = "walk"; | ||
|
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.
animatedSprite2D.FlipV = false; | ||
// See the note below about the following boolean assignment. |
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.
animatedSprite2D.FlipV = false; | |
// See the note below about the following boolean assignment. | |
// See the note below about the following boolean assignment. | |
animatedSprite2D.FlipV = false; |
Or flip the order above in GDScript
.. tabs:: | ||
.. code-tab:: gdscript GDScript | ||
|
||
if velocity.x != 0: |
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.
if velocity.x != 0: | |
if velocity.x != 0: |
Problem: the character when moving down with angle the sprite was looking up not down
so i seperated the code responsible of the flipping