Add bullet shooting mechanics and refactor scenes

This commit is contained in:
Henry 2025-10-13 14:28:55 +01:00
parent 8501c18dd1
commit 85155b1c7d
6 changed files with 156 additions and 97 deletions

View file

@ -1,18 +1,16 @@
extends Area2D
@export var speed = -250
func _on_visible_on_screen_notifier_2d_screen_exited() -> void:
queue_free()
func _on_area_entered(area: Area2D) -> void:
if area.is_in_group("enemies"):
area.explode()
queue_free()
func start(pos):
position = pos
func _process(delta):
position.y += speed * delta
func _on_area_entered(area: Area2D) -> void:
if area.is_in_group("enemies"):
area.explode()
queue_free()
func _on_visible_on_screen_notifier_2d_screen_exited():
queue_free()