extends Node2D

# class member variables go here, for example:
# var a = 2
# var b = "textvar"
var screensize
var startnewgame = false

func _ready():
	# Called every time the node is added to the scene.
	# Initialization here
	screensize = get_viewport_rect().size
	$NewGameColorRect.hide()
	#ColorRect. = screensize

func _process(delta):
	$Scorelbl.text = "SCORE :  " + str($Game.score)
	$Healthlbl.text = "HEALTH :  " + str($Game.health)
	$Shieldslbl.text = "SHIELDS :  " + str($Game.shieldsready)
	$Levellbl.text = "LEVEL :  " + str($Game.level)
	#if $Game.health == 0:
	if $Game.health > 0:
		startnewgame = true
	if $Game.health == 0 and startnewgame:
		$NewGameColorRect.show()
	#if Input.is_action_pressed("ui_select"):
	#	$Game.newgame = true
	#	print ("New game!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")

#	# Called every frame. Delta is time since last frame.
#	# Update game logic here.
#	pass


func _on_Button_pressed():
	$NewGameColorRect.hide()
	startnewgame = false
	$Game.newgame = true

