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,24 @@
class_name KillPlayerOutOfScreen
extends Node
@export var screen_notifier: VisibleOnScreenNotifier2D
@export var health_component: HealthComponent
func _ready() -> void:
if not screen_notifier:
printerr("KillPlayerOutOfScreen: screen_notifier is not set.")
return
if not health_component:
printerr("KillPlayerOutOfScreen: health_component is not set.")
return
screen_notifier.screen_exited.connect(out_of_screen)
func out_of_screen() -> void:
if not health_component:
return
health_component.decrease_health(6000)