GodotGameWorkshop/Scripts/MemoryPiece.gd
doctorbatmanwho-creator 89c109b26f Add wardrobe memory encounters and combat area backgrounds
- Implemented MemoryPiece collectible system
- Added support for unique memory fragment textures
- Continued wardrobe encounter workflow design
- Planned memory collection and return-to-graveyard progression
- Created Wardrobe 1 (Hide) combat background
- Created Wardrobe 2 (Hurry) combat background
- Created Wardrobe 3 (Silence) combat background
- Created Wardrobe 4 (Isolation) combat background
- Created Wardrobe 5 (Responsibility) combat background
- Added environmental storytelling text and thematic scene concepts
- Continued graveyard level layout and wardrobe encounter planning
2026-06-14 22:07:32 -04:00

35 lines
757 B
GDScript

@tool
extends Area2D
@export var memory_texture: Texture2D:
set(value):
memory_texture = value
if $Sprite2D:
$Sprite2D.texture = memory_texture
@export var return_spawn: Marker2D
@export var wardrobe: Node2D
@onready var sprite: Sprite2D = $Sprite2D
func _ready() -> void:
if memory_texture:
sprite.texture = memory_texture
if not Engine.is_editor_hint():
body_entered.connect(_on_body_entered)
func _on_body_entered(body: Node) -> void:
if body is Player:
print("Memory piece collected")
if wardrobe and wardrobe.has_method("complete_wardrobe"):
wardrobe.complete_wardrobe()
if return_spawn:
body.global_position = return_spawn.global_position
else:
print("No return_spawn assigned to memory piece")
queue_free()