Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/third_party/tiny-swords/Deco/17.png

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.

Good idea using Sprite2D frames for making this simpler. This is changing a third-party asset. TinySwords "legacy". But I think is fine, because PixelFrog is not going to update it. Updates go to the new pack (which we ship in assets/third_party/tiny-swords-non-cc0/ with permission from PixelFrog).

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion scenes/game_elements/props/sign/components/sign.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ func _ready() -> void:


func update_appearance() -> void:
$Appearance.flip_h = direction == Enums.LookAtSide.RIGHT
if direction == Enums.LookAtSide.UNSPECIFIED:
$Appearance.frame = 0

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.

It would be better to add an enum so the frames 0 and 1 have more meaning. Also considering that at one point we will have 2 more frames, for pointing up and for pointing down (check #2932).

$Appearance.flip_h = false
else:
$Appearance.frame = 1
$Appearance.flip_h = direction == Enums.LookAtSide.RIGHT
Comment on lines +30 to +35

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.

Can you add a unique name to the Appearance node, and reference it with it here? Check https://github.com/endlessm/threadbare/wiki/Contributing#use-unique-names-to-reference-nodes-in-scripts

This predates to your changes, the sign is one of the oldest components in this repository and it doesn't follow the current conventions.



func _on_area_2d_body_entered(_body: Node2D) -> void:
Expand Down
2 changes: 2 additions & 0 deletions scenes/game_elements/props/sign/sign.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ script = ExtResource("1_cb2ey")
[node name="Appearance" type="Sprite2D" parent="." unique_id=1364985273]
texture = ExtResource("2_85li6")
offset = Vector2(0, -30)
hframes = 2
frame = 1

[node name="Collider" type="StaticBody2D" parent="." unique_id=882843758]
collision_layer = 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ script = ExtResource("1_onayf")
[node name="Appearance" type="Sprite2D" parent="." unique_id=1240587292]
texture = ExtResource("2_cl2dx")
offset = Vector2(0, -30)
hframes = 2
frame = 1

[node name="Collider" type="StaticBody2D" parent="." unique_id=928850480]
collision_layer = 16
Expand Down
Loading