final is here

This commit is contained in:
2025-09-08 21:58:22 +02:00
parent 2781204d6d
commit f91ae53533
20 changed files with 269 additions and 74 deletions

View File

@@ -5,7 +5,7 @@ extends CanvasLayer
var player_life:= 3
var score := 0
var time := 0.0
@export var show_score :PackedScene = load("res://scene/score_particles.tscn")
func _ready() -> void:
GameController.connect("player_hit", update_player)
@@ -14,12 +14,21 @@ func _ready() -> void:
func _process(delta: float) -> void:
time += delta
func update_score(add : int)->void:
score += 2 ** (5-add) * (1 + (time / 100))
func update_score(add : int, ast_pos: Vector2)->void:
var temp = 2 ** (5-add) * (1 + (time / 100))
spawn_score(temp,ast_pos)
score += temp
label_score.text = str(score)
func update_player() -> void:
func update_player(_type:bool) -> void:
player_life -= 1
if player_life < 0:
GameController.emit_signal("go_to_score_saver", score)
box_player1.get_children(false)[player_life].visible = false
func spawn_score(score: int,pos : Vector2)->void:
var new = show_score.instantiate()
new.global_position = pos
new.score = score
get_parent().add_child(new)