This commit is contained in:
Hazel Layne Aranda 2021-03-09 15:53:23 -05:00
parent 827abde68f
commit 30aad69fff
Signed by: hazelra
GPG key ID: 09213F100E5E4E67
17 changed files with 677 additions and 0 deletions

View file

@ -0,0 +1,25 @@
extends Area2D
export var ship_path: NodePath
export var energy_usage: float
export var min_energy: float
onready var ship: Node = get_node(ship_path)
var active = false
func activate():
if ship.energy > min_energy:
active = true
$Static.visible = true
$Shape.disabled = false
func deactivate():
active = false
$Static.visible = false
$Shape.disabled = true
func _physics_process(delta):
if active:
if !ship.set_energy(ship.energy - energy_usage * delta):
deactivate()