extends Area2D

enum MaskType { NONE, TRIANGLE, CIRCLE, SQUARE }

@export var mask_type : MaskType = MaskType.NONE
@onready var sprite = $Sprite2D

var TRIANGLE_MASK = preload("res://assets/masks/triangle_mask.png")
var CIRCLE_MASK = preload("res://assets/masks/circle_mask.png")
var SQUARE_MASK = preload("res://assets/masks/square_mask.png")

func _ready():
	body_entered.connect(_on_body_entered)
	match mask_type:
		MaskType.CIRCLE:
			sprite.texture = CIRCLE_MASK
		MaskType.SQUARE:
			sprite.texture = SQUARE_MASK
		MaskType.TRIANGLE:
			sprite.texture = TRIANGLE_MASK
		_:
			pass

func _on_body_entered(body):
	if body.name == "Player":
		body.set_mask(mask_type)
		queue_free()
