paratate/globals/currentgame.gd
2025-12-31 17:29:53 -05:00

35 lines
882 B
GDScript

extends Node
@export var score = 0
@export var graze = 0
@export var level_graze = 0
@export var lives = 2
@export var bombs = 3
#func _process(delta: float) -> void:
#print(Display.current_scene)
func change_score(amount):
score += amount
Hud.score_label.text = str("SCORE: ") + str(score)
func change_graze(amount):
graze += amount
level_graze += amount
Hud.graze_label.text = str("GRAZE: ") + str(level_graze)
func change_lives(amount):
lives += amount
lives = clamp(lives,-1,9)
Hud.lives_label.text = str("LIVES: ") + str(lives)
if lives < 0:
Hud.lives_label.text = str("LIVES: ") + str(0)
var Gover = load("res://menus/game_over.tscn")
var gover = Gover.instantiate()
#TODO implement properly
get_tree().paused = true
Display.viewport.add_child(gover)
func change_bombs(amount):
bombs += amount
Hud.bombs_label.text = str("BOMB: ") + str(bombs)