2023-06-07 00:13:37 +10:00
|
|
|
class_name PlayerController
|
|
|
|
extends Node
|
2023-06-07 01:24:11 +10:00
|
|
|
|
2023-06-08 15:44:43 +10:00
|
|
|
var player_info
|
|
|
|
@export var hand_position: Node2D
|
|
|
|
var hand = []
|
|
|
|
|
|
|
|
|
|
|
|
func draft(cards, _pick):
|
|
|
|
var xxx = (250.0 * cards.size()) / 2.0
|
|
|
|
for x in cards.size():
|
|
|
|
var card = cards[x]
|
|
|
|
var ratio = float(x) / float(cards.size() - 1)
|
|
|
|
var xx = lerpf(-1 * xxx, xxx, ratio)
|
|
|
|
card.slide_to_position(hand_position.global_position.x + xx, hand_position.global_position.y, 0.0, 0.2)
|
|
|
|
hand.append(card)
|