-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/bdh-5/deck #2
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
Conversation
…ect and script 2:05 of https://youtu.be/riafP7MtvmQ?si=IrNjwHy4YW2-ShC2 next: raycast so deck can see click, create interaction/input manager
project/Scripts/InputManager.gd
Outdated
| emit_signal("left_mouse_button_released") | ||
|
|
||
|
|
||
| func racast_at_cursor(): |
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.
racast... -> raycast
|
|
||
|
|
||
| func add_card_to_hand(card): | ||
| func add_card_to_hand(card, speed=DEFAULT_CARD_MOVE_SPEED): |
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.
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): |
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.
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): |
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.
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.
Changes for DECK - Godot 4.3 Card Game Tutorial #5 episode of Barry's Development Hell Card Game Tutorial Series