Add spaceship interaction components and update player movement logic

This commit is contained in:
2025-05-25 19:26:41 +02:00
parent 129fc17f13
commit bac0a8c5f7
19 changed files with 286 additions and 36 deletions

View File

@@ -0,0 +1,21 @@
class_name SpaceshipEnterComponent
extends Node
@export var area2d: Area2D
signal spaceship_entered
func _ready() -> void:
if not area2d:
printerr("SpaceshipEnterComponent: area2d is not set.")
return
area2d.body_entered.connect(_on_area2d_body_entered)
func _on_area2d_body_entered(body: Node2D) -> void:
if not body is PlayerController:
return
spaceship_entered.emit()
owner.queue_free()