mirror of
https://github.com/mx42/my-gd-game.git
synced 2026-01-14 05:19:50 +01:00
chore: fix warnings (?)
This commit is contained in:
@@ -37,6 +37,10 @@ func _ready() -> void:
|
||||
star.scale = Vector2(s, s);
|
||||
get_tree().call_group("ui", "set_health", health);
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if health <= 0:
|
||||
get_tree().change_scene_to_file("res://scenes/game_over.tscn");
|
||||
|
||||
func _on_meteor_timer_timeout() -> void:
|
||||
$MeteorTimer.wait_time = Global.meteor_base_timer;
|
||||
var meteor = meteor_scene.instantiate();
|
||||
@@ -46,10 +50,7 @@ func _on_meteor_timer_timeout() -> void:
|
||||
func _on_meteor_collision() -> void:
|
||||
health -= 1;
|
||||
get_tree().call_group("ui", "set_health", health);
|
||||
if health <= 0:
|
||||
get_tree().change_scene_to_file("res://scenes/game_over.tscn");
|
||||
else:
|
||||
$ShipHit.play();
|
||||
$ShipHit.play();
|
||||
|
||||
func _on_player_laser(pos: Vector2) -> void:
|
||||
var laser = laser_scene.instantiate();
|
||||
|
||||
@@ -29,7 +29,7 @@ func _process(delta) -> void:
|
||||
func _on_body_entered(_body: Node2D) -> void:
|
||||
if can_collide:
|
||||
collision.emit();
|
||||
queue_free();
|
||||
call_deferred("queue_free");
|
||||
|
||||
func _on_area_entered(area: Area2D) -> void:
|
||||
area.queue_free();
|
||||
@@ -37,5 +37,5 @@ func _on_area_entered(area: Area2D) -> void:
|
||||
Global.score += 10;
|
||||
$MeteorImage.hide();
|
||||
can_collide = false;
|
||||
await get_tree().create_timer(0.5).timeout;
|
||||
queue_free();
|
||||
#await get_tree().create_timer(0.5).timeout;
|
||||
call_deferred("queue_free");
|
||||
|
||||
Reference in New Issue
Block a user