[wip] display Deck

This commit is contained in:
Fabien Freling 2021-12-06 23:44:23 +01:00
parent 5007d7aa2a
commit 65af79679f
2 changed files with 14 additions and 2 deletions

13
Deck.gd
View file

@ -1,4 +1,4 @@
extends Node
extends Node2D
var HanafudaCard = preload("res://HanafudaCard.tscn")
@ -64,7 +64,18 @@ onready var cards = [
HanafudaCard.instance().init_card(Enums.Month.DECEMBER, Enums.Type.SCRAP_3),
]
var card_order = []
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
init_card_order()
for c in cards:
add_child(c)
var card: HanafudaCard = cards[0]
card.reveal(true)
func init_card_order() -> void:
card_order.resize(cards.size())
for i in range(cards.size()):
card_order[i] = i

View file

@ -16,8 +16,9 @@ __meta__ = {
}
[node name="HanafudaCard" parent="." instance=ExtResource( 1 )]
visible = false
position = Vector2( 205, 447 )
month = 2
[node name="Deck" type="Node" parent="."]
[node name="Deck" type="Node2D" parent="."]
script = ExtResource( 3 )