20 lines
529 B
GDScript

extends Node3D
# The player's ship, a safe zone where they can deposit grunk, save their game, and relax.
@onready var tank_interactor: Interactive = %TankInteractor
func _ready() -> void:
Game.manager.grunk_collected.connect(_enable_tank)
func _enable_tank(_delta: float) -> void:
tank_interactor.enabled = true
## Called when the player interacts with the grunk tank.
func deposit_grunk() -> void:
# Tank is disabled until the player collects more grunk.
tank_interactor.enabled = false
Game.manager.deposit_tank()