extends Area2D

signal clicked

var min_ = 1
var max_ = 52

func reinit():
	$Label.text = "00"

func _ready():
	randomize()


func _on_RandNumber_input_event(viewport, event, shape_idx):
	if event is InputEventMouseButton \
	and event.button_index == BUTTON_LEFT \
	and event.pressed:
		emit_signal("clicked")


func _on_RandNumber_clicked():
	switch_number()

func switch_number():
	$Label.text = str(randi() % (max_ - min_ + 1) + min_)
