extends Area2D

export var health : float = 100

var game_over = preload("res://GameOver.tscn")

func _physics_process(delta):
	if health <= 0:
		var gameover_screen = game_over.instance()
		gameover_screen.score = int($"../../Score".score)
		
		$"../..".queue_free()
		
		$"../..".get_parent().add_child(gameover_screen)
