Added shield and score UI; player collision signal connected to enemy
This commit is contained in:
parent
996a0bb8f7
commit
8175e1469d
17 changed files with 321 additions and 15 deletions
17
scenes/EnemyBullet.gd
Normal file
17
scenes/EnemyBullet.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extends Area2D
|
||||
|
||||
@export var speed = 150
|
||||
|
||||
func start(pos):
|
||||
position = pos
|
||||
|
||||
func _process(delta):
|
||||
position.y += speed * delta
|
||||
|
||||
func _on_visible_on_screen_notifier_2d_screen_exited():
|
||||
queue_free()
|
||||
|
||||
func _on_area_entered(area):
|
||||
if area.name == "Player":
|
||||
queue_free()
|
||||
area.shield -= 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue