untap/player.gd

33 lines
786 B
GDScript

extends Node2D
var _card_class = preload("res://card.gd")
var card
func _on_request_completed(result, response_code, headers, body):
var json = JSON.parse_string(body.get_string_from_utf8())
print(json["name"])
func _test_func():
card.load_card()
print(card.card_id)
print(card.card_name)
print(card.card_type)
print(card.oracle_text)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
# TODO: Create 2-4 player instances as children of this tabletop node.
card = _card_class.new("d3f10f07-7cfe-4a6f-8de6-373e367a731b")
add_child(card)
card.cache_done.connect(_test_func)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass