21 lines
450 B
GDScript
21 lines
450 B
GDScript
extends Node2D
|
|
|
|
@export var hat_type:= "dunce1"
|
|
|
|
var hat_texture = load("res://art/hats/" + str(hat_type) + ".png")
|
|
|
|
func _ready() -> void:
|
|
pass
|
|
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|
|
func on_contact(body: Node2D) -> void:
|
|
print("BODY: " + str(body))
|
|
%Player2D/HatSound.play()
|
|
visible = false
|
|
%Player2D/Sprite2D/HatSprite.texture = hat_texture
|
|
%Player2D/Sprite2D/HatSprite.show()
|
|
await get_tree().create_timer(0.2).timeout
|
|
queue_free()
|