Files
SWGalaga/Scripts/missile.gd

18 lines
353 B
GDScript3
Raw Normal View History

2024-06-03 05:29:11 -04:00
extends Area2D
var speed = 200
@onready var FirstStage = $CollisionShape2D
@onready var SecondStage = $CollisionPolygon2D
func _physics_process(delta):
global_position.y += -speed * delta
func _on_area_entered(area):
if area.is_in_group("enemies"):
FirstStage.disabled = true
SecondStage.disabled = false
area.take_damage(5)
queue_free()