various updates
This commit is contained in:
parent
8d6da7bf7e
commit
43b52fcea9
17 changed files with 244 additions and 109 deletions
|
|
@ -3,6 +3,12 @@ extends Node
|
|||
signal game_win
|
||||
signal game_lose
|
||||
|
||||
@export var ufo_speed : float = 0.1
|
||||
@export_group("Node References")
|
||||
@export var ufo_path : PathFollow2D
|
||||
|
||||
var ufo_progress : float
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
|
@ -10,4 +16,13 @@ func _ready() -> void:
|
|||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
ufo_progress += delta * ufo_speed
|
||||
ufo_path.progress_ratio = ufo_progress
|
||||
if ufo_progress >= 1:
|
||||
print("invaders lose")
|
||||
game_lose.emit()
|
||||
|
||||
|
||||
func _on_ufo_area_entered(area: Area2D) -> void:
|
||||
print("invaders win")
|
||||
game_win.emit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue