hanafuda/HanafudaCard.gd

55 lines
831 B
GDScript3
Raw Normal View History

2021-11-21 20:44:08 +01:00
tool
extends Node2D
2021-11-16 23:22:54 +01:00
enum Month {
JANUARY,
FEBRUARY,
MARCH,
APRIL,
MAY,
JUNE,
JULY,
AUGUST,
SEPTEMBER,
OCTOBER,
NOVEMBER,
DECEMBER,
}
enum Flower {
PINE,
PLUM_BLOSSOM,
CHERRY_BLOSSOM,
WISTERIA,
IRIS,
PEONY,
BUSH_CLOVER,
GRASS,
CHRYSANTHEMUM,
MAPLE,
WILLOW,
PAULOWNIA,
}
2021-11-21 20:44:08 +01:00
export var revealed: bool = true setget reveal
2021-11-16 23:22:54 +01:00
# Called when the node enters the scene tree for the first time.
func _ready():
2021-11-21 20:44:08 +01:00
$Backside/TextureRect.rect_global_position = $"Backside/Border sprite".get_rect()
reveal(revealed)
2021-11-16 23:22:54 +01:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
2021-11-21 20:44:08 +01:00
func _process(delta):
pass
func reveal(new_reveal: bool):
revealed = new_reveal
if revealed:
print("Reveal card")
$Frontside.show()
$Backside.hide()
else:
print("Conceal card")
$Frontside.hide()
$Backside.show()