hanafuda/HanafudaCard.gd

60 lines
823 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-21 23:29:05 +01:00
onready var _is_ready := true
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
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
2021-11-21 23:29:05 +01:00
if not _is_ready:
yield(self, "ready")
2021-11-21 20:44:08 +01:00
if revealed:
print("Reveal card")
$Frontside.show()
$Backside.hide()
else:
print("Conceal card")
$Frontside.hide()
$Backside.show()