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