Skip to content

Conversation

@pb-413
Copy link
Owner

@pb-413 pb-413 commented Feb 22, 2025

emit_signal("left_mouse_button_released")


func racast_at_cursor():
Copy link
Owner Author

Choose a reason for hiding this comment

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

racast... -> raycast



func add_card_to_hand(card):
func add_card_to_hand(card, speed=DEFAULT_CARD_MOVE_SPEED):
Copy link
Owner Author

Choose a reason for hiding this comment

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

Deck.gb adds at a different speed (draw_card), so this function correctly has a new parameter with a default constant. We take advantage of the default in finish_drag when we return a card to hand.



func update_hand_positions():
func update_hand_positions(speed=DEFAULT_CARD_MOVE_SPEED):
Copy link
Owner Author

Choose a reason for hiding this comment

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

In one place we pass a new speed (see add_card_to_hand()) and in another we take advantage of the default: remove_card_from_hand.



func animate_card_to_position(card, new_position):
func animate_card_to_position(card, new_position, speed=DEFAULT_CARD_MOVE_SPEED):
Copy link
Owner Author

Choose a reason for hiding this comment

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

We never take advantage of this default because the functions (add_card_to_hand and update_hand_positions) that call this function, animate_card_to_position, also take a speed.

Should this function not have a default? Adding a code comment to this effect.

@pb-413 pb-413 merged commit 39346cb into main Feb 22, 2025
@pb-413 pb-413 deleted the feature/BDH-5/deck branch February 22, 2025 02:46
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.

2 participants