funcv
This commit is contained in:
parent
50ba465b7b
commit
4a41e24291
11
Enemy.gd
11
Enemy.gd
|
@ -11,10 +11,7 @@ func _physics_process(delta):
|
|||
look_at(Player.position)
|
||||
move_and_collide(motion)
|
||||
|
||||
func _on_Area2D_body_entered(body):
|
||||
if "Bullet" in body.name:
|
||||
queue_free()
|
||||
|
||||
func spawn():
|
||||
var t = Timer.new()
|
||||
t.set_wait_time(3)
|
||||
t.set_one_shot(true)
|
||||
|
@ -33,3 +30,9 @@ func _on_Area2D_body_entered(body):
|
|||
enemy.position.y = y
|
||||
enemy.position.x = x
|
||||
add_child(enemy)
|
||||
|
||||
func _on_Area2D_body_entered(body):
|
||||
if "Bullet" in body.name:
|
||||
spawn()
|
||||
queue_free()
|
||||
|
||||
|
|
Loading…
Reference in New Issue