Add bullet shooting mechanics and refactor scenes
This commit is contained in:
parent
8501c18dd1
commit
85155b1c7d
6 changed files with 156 additions and 97 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue