Skip to content

Doors: Add property to flip horizontally #2836 - #2935

Merged
manuq merged 7 commits into
endlessm:mainfrom
BFoster-BF:Fix-Doors-Add-property-to-flip-horizontally-#2836
Sep 22, 2026
Merged

manuq merged 7 commits into
endlessm:mainfrom
BFoster-BF:Fix-Doors-Add-property-to-flip-horizontally-#2836

Conversation

@BFoster-BF

@BFoster-BF BFoster-BF commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

The door sprite can now be flipped horizontally with the use of the "flip_horizontal" Boolean. This affects only the visuals, not the collision shape as requested.

Resolves #2836

The door sprite can now be flipped horizontally with the use of the "flip_horizontal" Boolean. This affects only the visuals, not the collision shape as requested.
Resolves endlessm#2836
@BFoster-BF
BFoster-BF requested a review from a team as a code owner September 20, 2026 07:02

@manuq manuq left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Excellent!



func update_door_flip() -> void:
%DoorOpened.flip_h = flip_horizontal

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

Comment thread scenes/game_elements/props/door/components/door.gd Outdated
Comment on lines +48 to +51
if flip_horizontal:
%DoorOpened.position.x = -abs(%DoorOpened.position.x)
else:
$DoorOpened.position.x = abs(%DoorOpened.position.x)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice! In other components of the game we change the scaling to -1 for flippling all the visuals. You could do the same by adding all the visuals (door opened and closed Sprite2Ds) to a parent Node2D with position Vector2.ZERO. But I think this works fine!

func _set_look_at_side(new_look_at_side: Enums.LookAtSide) -> void:
	look_at_side = new_look_at_side
	scale.x = -1 if look_at_side == Enums.LookAtSide.RIGHT else 1

@manuq
manuq requested a review from a team as a code owner September 22, 2026 13:39
Comment thread scenes/game_elements/props/door/components/door.gd Outdated
Comment on lines +43 to +47


func update_door_flip() -> void:
%DoorOpened.flip_h = flip_horizontal

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
func update_door_flip() -> void:
%DoorOpened.flip_h = flip_horizontal
func update_door_flip() -> void:
%DoorOpened.flip_h = flip_horizontal

Comment thread scenes/game_elements/props/door/components/door.gd Outdated
@github-actions

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown

Test build no longer available.

Comment thread scenes/game_elements/props/door/components/door.gd Outdated
Comment thread scenes/game_elements/props/door/components/door.gd Outdated
Comment thread scenes/game_elements/props/door/components/door.gd
@manuq
manuq merged commit 592cce3 into endlessm:main Sep 22, 2026
6 checks passed
@manuq

manuq commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

@BFoster-BF thanks for your contribution! This time I applied a few format fixes regarding white space, and changed a $ by a %. Next time you could install pre-commit as explained here so the formatting is automatically fixed by that tool.

Also I did a small change in the pull request description (moving "Resolves..." to a new line). You may want to check this section in the same page as above for your next contribution. Thanks!

@manuq

manuq commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

I created a followup ticket for actually testing this in a demo level: #2949

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.

Doors: Add property to flip horizontally

2 participants