File size: 436 Bytes
c5a8672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
extends Node3D

var contacts := []

func _on_timer_timeout():
	explode()
	$powerupBomb.visible = false
	$Sparks.set_emitting(true)
	$Flash.set_emitting(true)

	await $Sparks.finished
	queue_free()

func explode():
	for contact in contacts:
		if contact is Player:
			contact.hit_by_bomb()

func _on_damage_radius_body_exited(body:Node3D):
	contacts.erase(body)

func _on_damage_radius_body_entered(body:Node3D):
	contacts.append(body)